Huge number of zmswap files

Forum for questions and support relating to the 1.29.x releases only.
Locked
Henri
Posts: 29
Joined: Mon May 16, 2011 7:39 pm

Huge number of zmswap files

Post by Henri »

Hello,

I was migrating my installation (Database) from 1.27 to 1.29 PPA. The migration was not causing any problem to me, but now i get allways thousands of files (jpg) when im watching a single camera stream (all the cameras are using the same filename zmswap-ixxxxx.jpg).
This was not the case in 1.27 (every camera was using one single file), what is causing this problem and how can i solve this.
My system is running on Ubuntu 16.04 with 8 cameras with 8GB of memory and 1TB of diskspace.

Thank in advance for your support,
Henri
bbunge
Posts: 2956
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Huge number of zmswap files

Post by bbunge »

That is normal operation. By default your tmp directory is used for swap files but you can change the swap path to use tmpfs. Doing this will improve performance as writing to RAM is faster than writing to disk.
Henri
Posts: 29
Joined: Mon May 16, 2011 7:39 pm

Re: Huge number of zmswap files

Post by Henri »

Hello,
Is this the same for Version 1.30.
Thank you for your quick answer and thank you to all the developers of Zoneminder for the good job they did.
Best regards,
Henri
User avatar
knight-of-ni
Posts: 2406
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: Huge number of zmswap files

Post by knight-of-ni »

One of the cool things about github is the ability to rather easily go back in time. Here is the copy of zm_monitor.cpp from Nov 3, 2010, which was part of zoneminder prior to version 1.25, with the relevant line of code highlighted:
https://github.com/ZoneMinder/ZoneMinde ... .cpp#L3589

The "%5d" represents the five digit, incrementing integer in the filename.
As you can see the line of code that creates all the zmswap-ixxxxx.jpg swap files is there, and has been there for a long time.
You only now noticed.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/
Henri
Posts: 29
Joined: Mon May 16, 2011 7:39 pm

Re: Huge number of zmswap files

Post by Henri »

I dont agree that there is no change in handling this swap files from earlier versions.
In Version 1.27 the swap files were located in separated directorys (by Monitor) and the files have been erased when the streaming was stopped (closing window).
Now all the Monitors are streaming in the same directory.
Locked