If I execute the Python interpreter it needs roughly 111 MByte:
>>> import psutil
>>> psutil.Process().memory_info()
pmem(rss=19451904, vms=111677440, shared=6905856, text=4096, lib=0, data=12062720, dirty=0)
After importing django it uses 641 MByte
>>> import django
>>> django.setup()
>>> psutil.Process().memory_info()
pmem(rss=188219392, vms=641904640, shared=27406336, text=4096, lib=0, data=284606464, dirty=0)
And the WSGI process (which has already executed some http requests) 919 MByte:
>>> psutil.Process(13843).memory_info()
pmem(rss=228777984, vms=919306240, shared=16076800, text=610304, lib=0, data=485842944, dirty=0)
I think that's too much.
What can I do to investigate this in more detail? What occupies the memory?
Background: From time to time memory on the server is running low and the oom-killer terminates processes.
vms
essentially tells you how much address space your program has been allocated, not how much RAM is in use. See eg. this answer. – Betake