OpenQNX :: The QNX Community Portal

Jul 25, 2008 - 04:38 PM
Google
  Web openqnx.com   
     Create an account Home · Submit News · QNX Forums · QNX Download · Search   
_
Main Menu
Who's Online
There are 27 unlogged users and 1 registered user online.

You can log-in or register for a user account here.

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Flying_in_QNX
20 Post subject: Need your help, Memory Leak  PostPosted: Mar 18, 2008 - 02:01 PM
New Member


Joined: Jan 19, 2006
Posts: 9

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 a severe leak, 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.
 
 View user's profile Send private message  
Reply with quote Back to top
Tim
Post subject:   PostPosted: Mar 18, 2008 - 02:25 PM
Senior Member


Joined: Mar 10, 2004
Posts: 544

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
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Flying_in_QNX
Post subject:   PostPosted: Mar 18, 2008 - 03:48 PM
New Member


Joined: Jan 19, 2006
Posts: 9

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.
.
 
 View user's profile Send private message  
Reply with quote Back to top
mario
Post subject:   PostPosted: Mar 18, 2008 - 05:13 PM
QNX Master


Joined: Sep 01, 2002
Posts: 2783

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.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
rgallen
Post subject:   PostPosted: Mar 18, 2008 - 06:46 PM
QNX Master


Joined: Jul 11, 2002
Posts: 600

mario wrote:
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...
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
maschoen
Post subject:   PostPosted: Mar 19, 2008 - 02:06 AM
QNX Master


Joined: Jun 25, 2003
Posts: 1045

Is it possible that you are creating permanent shared memory objects?
 
 View user's profile Send private message Send e-mail Visit poster's website  
Reply with quote Back to top
Flying_in_QNX
20 Post subject:   PostPosted: Mar 19, 2008 - 03:17 PM
New Member


Joined: Jan 19, 2006
Posts: 9

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
 
 View user's profile Send private message  
Reply with quote Back to top
mario
Post subject:   PostPosted: Mar 19, 2008 - 04:26 PM
QNX Master


Joined: Sep 01, 2002
Posts: 2783

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.
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2007 The PNphpBB Group
Credits
All logos and trademarks in this site are property of their respective owners. The comments are property of their posters.
Powered by OpenQNX: The QNX Community Portal Site
QNX and the QNX logo are registered trademarks of QNX Software Systems.