Kernel Not Able to Regain Deallocated Memory

Kedar Pimplikar kedar.pimplikar at patni.com
Thu Jan 20 12:31:22 UTC 2005


Hello All,

I have a process, which makes use of recursive function,
and in each call, allocates lot of memory on stack.

When I run this process on Redhat Linux AS 3.0 (IA-32),
(Kernel:2.4.21-4.EL) it has a little strange behavior.

Free Memory before running my process: @ 380 MB
Free Memory after running my process: @ 80 MB

I am sure that my application does not consume this huge memory. (@300 MB)
It allocates a very little memory @ 8 KB dynamically, which it frees
correctly.
My application does not have any memory leaks.
I have confirmed it through code-review and rational purify.

My doubts are:
1. Is this behavior of kernel is actually a feature (and not a bug) or
kernel is unable to recover memory deallocted by a process.
(If yes, please let me know if is documented)

2. Are bdflush parameters responsible for this behavior?
My current bdflush parameters are as
#cat /proc/sys/vm/bdflush
50      500     0       0       500     3000    80      50      0

I tried manipulating these values but no improvement seen.

I also tried to process behavior as follows:
Instead allocating huge memory on stack, I allocate it dynamically on heap.
This way I can ensure the freeing up of memory.
But still result is same.

One more interesting observation:
After running my application once, (kernel has @ 80 MB free memory)
I rerun my application but this time there is no drop in free memory.

Any input in this regard will really help me.

(Thanks anyway for reading this far...)


Regards,
Kedar.



http://www.patni.com
World-Wide Partnerships. World-Class Solutions.
_____________________________________________________________________

This e-mail message may contain proprietary, confidential or legally
privileged information for the sole use of the person or entity to
whom this message was originally addressed. Any review, e-transmission
dissemination or other use of or taking of any action in reliance upon
this information by persons or entities other than the intended
recipient is prohibited. If you have received this e-mail in error
kindly delete  this e-mail from your records. If it appears that this
mail has been forwarded to you without proper authority, please notify
us immediately at netadmin at patni.com and delete this mail. 
_____________________________________________________________________


More information about the redhat-list mailing list