I have a python script (exe made with py2exe) that runs on several machines. This Python exe does two things periodically; one thread writes a py file for further treatment while another thread listens on a tcp port using the pyZmq
module. The has run perfectly for days, using around 12Mo of ram.
Now here is the problem : these machines also run 3dsmax
rendering. 3dsmax
takes all available ram on the system, leaving only 4Mo of ram for my script. In this state, the reporting (py file writing) thread runs correctly, but the one that listens on the tcp port doesn't work anymore (sending msg to the machine don't get received).
However, this python exe process runs on high level priority :
set_nice(psutil.HIGH_PRIORITY_CLASS)
So, how can I reserve 14Mo of ram for my process, so that no other process running can take this ram ? Or another way to avoid the exe to 'give' his ram to other processes?
Thanks, Kib