I have a python memory management problem.

I have a django application running on windows that loads a 2gb model in memory (using dictionary and numpy).

The problem happens when I run this application in the background (using the windows scheduler), after some time without requests, python frees dictionary memory by storing the values ​​on disk.

When I have requests again, python loads these values ​​in memory again, caches again, which ends up increasing the response time of the first requests (normalizing right after, when the values ​​are in memory again).

I wonder if there is any way to force python to keep these variables in cache, so that it does not do this management on its own.