Page 1 of 1

Huge number of zmswap files

Posted: Fri Oct 21, 2016 9:09 pm
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

Re: Huge number of zmswap files

Posted: Sat Oct 22, 2016 12:28 pm
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.

Re: Huge number of zmswap files

Posted: Sat Oct 22, 2016 12:40 pm
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

Re: Huge number of zmswap files

Posted: Sat Oct 22, 2016 1:25 pm
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.

Re: Huge number of zmswap files

Posted: Sat Oct 22, 2016 5:39 pm
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.