Community mailing list archives
Re: wkhtmltopdf severe memory leakby
Interesting indeed, thanks! In our case I can report/confirm swapping activity right after filling up available memory.
Acording to your analysis this could mean:
- Either it's a different beast
- Or GCQ's instances hace a different treatment of malloc(). I don't know the kernel details.
Thanks & Best, David
2016-07-28 22:53 GMT+02:00 Ray Carnes <email@example.com>:
After increasing the worker limit_memory_hard parameter to 2GB we have had no further reports of any problems.Hi,Some extra info here,We have also seen the issue with wkhtmltopdf. Indeed, our experience is that with 2GB limit_memory_hard, the problem goes away.What you must understand is that wkhtmltopdf does a "malloc()" system call for a fairly large amount of memory. With the standard values of limit_memory_hard you run into trouble with this fairly soon.
Now on the malloc() system call, this does a memory reservation. On Linux this does not mean that this memory is actually "used"!! When the linux kernel receives the malloc() system call, it will allocate memory to the process. When the memory actually gets used by the application, the linux memory manager will allocate physical memory pages for the process. Only at this moment memory pages are freed from the cache or memory pages from other process might get swapped out to swap areas.Because of this, wkhtmltopdf can work fine without provisioning large amounts of memory for it.