Memory not free after kill?

Hi, folks:

I'm using uClinux (2.4.19) for my project. What I want to do is to kill a few processes to free up memory before a memory-hungry process can be run. What I discover is, not much memory is freed after kill -9.

Please refer the bottom for detail info.

I was expecting the available memory is the same before and after kill BoA. Can anyone explain to me why the memory is gone?

BoA: ls -l

-rwxr-xr-x 1 0 0 113668 Jan 1 00:00 boa

  1. Before I run BoA, output of "cat meminfo"

total: used: free: shared: buffers: cached: Mem: 12963840 4308992 8654848 0 573440 585728 Swap: 0 0 0 MemTotal: 12660 kB MemFree: 8452 kB MemShared: 0 kB Buffers: 560 kB Cached: 572 kB SwapCached: 0 kB Active: 812 kB Inactive: 320 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 12660 kB LowFree: 8452 kB SwapTotal: 0 kB

  1. After run BoA. total: used: free: shared: buffers: cached: Mem: 12963840 5124096 7839744 0 692224 712704 Swap: 0 0 0 MemTotal: 12660 kB MemFree: 7656 kB MemShared: 0 kB Buffers: 676 kB Cached: 696 kB SwapCached: 0 kB Active: 928 kB Inactive: 444 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 12660 kB LowFree: 7656 kB SwapTotal: 0 kB

  1. After BoA is killed. total: used: free: shared: buffers: cached: Mem: 12963840 5111808 7852032 0 692224 712704 Swap: 0 0 0 MemTotal: 12660 kB MemFree: 7668 kB MemShared: 0 kB Buffers: 676 kB Cached: 696 kB SwapCached: 0 kB Active: 928 kB Inactive: 444 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 12660 kB LowFree: 7668 kB SwapTotal: 0 kB SwapFree: 0 kB

Reply to
adorusan
Loading thread data ...

linux doesnt collect the free memory as soon as its released. When u free a memory through a system call, it doesnt add immediately add it to the free buffer pool, it does so..either periodically or when it runs out of memory..at that time, it checks that which of the blocks has been freed and updates its free memory pool.

chill, sudip

Reply to
sudip05

Thanks for the reply.

However, is there a way to force the memory to be released immediately? I need this piece of information to estimate how much memory is available my application.

Cheers, Andrew Chang

Reply to
adorusan

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.