Need your help, Memory Leak

My application seems no memory leak from system infomation view, But defact there is memory leak .The system’s total spending is increased.

In the Momentics help ,there is a line ::

"If your program has [size=150]a severe leak[/size], or leaks slowly but never terminates, it could consume all memory, perhaps even causing certain system services to fail. "

I don’t know what can make a server leak, Any body can give me some suggestion, Thanks in advance.

FlyingInQNX,

How are you determining there is a memory leak vs just normal programs using memory while they are running (adding data to linked lists etc)?

It’s also possible if you allocate and free a lot of memory that you are suffering heap fragmentation problems vs actual memory leak problems.

I also don’t understand what you mean when you say the ‘the systems total spending is increased’. Can you elaborate on that a little more.

Tim

Tim
thank you ,

I detected the system memory leak by using the QNX System Infomation tool ,found that total memory used is increasing in the system summary view. But in the Malloc Information view ,I can see My application almost release all the heap allocated.

Here is another hint, when I terminate my application, the leaked memory won’t be recycled.
.

Then maybe it’s not the application that you think that is leaking memory.

Start you system and run sin. Then start your software and after a while run another sin, post the output of both sin commands.

Also, it may not be a memory leak, but a resource leak of some other type. If you are just looking at total memory available, then kernel resources (which, of course, occupy memory) will cause the available memory to go down. You can only be sure it is a memory leak, if you find a process that has a heap that is growing over time…

Is it possible that you are creating permanent shared memory objects?

I still haven’t found out the reason of that cause the system memory leak yet.All the services and applications look like OK from memory analysis tool.But system total memory expending keeps growing by 10Mbytes/day

If you want us to help you, you need to provide more information, please post output of sin as suggested in previous post as well as output of ls -l /dev/shmem.