Menu

#25 DUMA leaks memory ;)

open
nobody
None
7
2010-01-24
2010-01-24
Anonymous
No

DUMA allocates memory in 1MB mmap but frees in slots used by application linked with DUMA. This also allows the possibility to leak memory.
create a sample program that allocates 300KB inside a while loop. run the application with DUMA_PROTECT_FREE set to any value greater than 0 but less than commit limit/ free memory. Theoretically this should run forever since protected memory will be released back to OS and thus mmap will always succeed, but will be killed soon with error "DUMA Aborting: mmap failed".
DUMA allocates memory in 1MB mmap but releases them in seperate slots that were used by applications. so in the above case it will use 900KB out of 1MB and the remaining 100KB that was never allocated to application will never be released and after a while this leak will grow to the point that mmap will fail.
This can be fixed by releasing all these DUMAST_FREE slots before calling Page_Create with AbortonFail set to 1.

Discussion


Log in to post a comment.

Auth0 Logo