# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 16507 | perforce_software | Move to main branch. | ||
#3 | 13690 | alan_petersen |
UPDATE: added locking mechanism to ThumbnailGenerator to prevent multiple scripts from running simultaneously. |
||
#2 | 13686 | alan_petersen |
Some people reported high CPU/RAM usage with the ThumbnailGenerator script, so I made some modifications to it: 1. ImageMagick was leaving around some temporary files after it ran, so now I clean up the TEMP_DIR location after the thumbnail attribute is set. this should prevent the temp directory from filling up. 2. I explicitly call gc.collect() after each call to generateThumbnail(). The thumbnail and hex versions get manipulated in memory in generateThumbnail() and I was relying on garbage collection to clean things up when the variables go out of scope, but gc.collect() is supposed to make it a little more explicit and help with performance, so I figured I could give it a try. 3. Experimenting on my VM, I ran the script and it gobbled up CPU (~70%) when running. I found that setting the nice level made it much less CPU-intense. For example: nice -n 19 ./ThumbnailGenerator.py -v -l /tmp/thumb.log -c 351 When run like this, the CPU usage (reported via top) peaked at about 2%. Coolio! |
||
#1 | 8919 | Matt Attaway | Initial add of Piper, a lightweight Perforce client for artists and designers. |