2008-01-24 06:53:43     Memory issues...

Document created by Aaronwu Employee on Aug 5, 2013
Version 1Show Document
  • View in full screen mode

2008-01-24 06:53:43     Memory issues...

Richard Aldrich (UNITED KINGDOM)

Message: 50092    Hi there, I have a number of programs running on the BF537 uclinux, and i'm trying to understand precisely where the memory is being used.

 

I have a watch dog program, which starts other programs running using the vfork and exec calls. This then checks if a program is still running and if not for any reason it will restart it.

 

Anyway, besides the watchdog process, if i run a program and then call "free" I can view what memory is available. If i kill a program i'd presume it would put me back to having the same amount of memory available as before i can the program. Or is this not the case? If a program crashes due to a Null pointer of memory allocation fault, would the memory be lost then or would it be freed up?

 

Ultimately, is there a way i can allocated a block of memory for running a process in, and then if the process closes for any reason, my watchdog process could tell the kernel that that area of memory is no longer being used and can therefore be freed to make it available to other programs?

 

Any ideas or comments greatly appreciated.

QuoteReplyEditDelete

 

 

2008-01-24 11:29:43     Re: Memory issues...

Mike Frysinger (UNITED STATES)

Message: 50105    when a process dies, all resources that were allocated for it should be freed.  if they arent, this is a bug, and it needs to get fixed.  (in the last release, there was a bug where an application causing a traceback would not have its resources reaped, but that has been fixed)

QuoteReplyEditDelete

 

 

2008-01-25 10:47:22     Re: Memory issues...

Richard Aldrich (UNITED KINGDOM)

Message: 50151    I'm using 2007R1.1-RC3 release, is this the most recent?

 

If I run a program and then kill it, i have less free memory afterwards than I did before (using the "free" call)..also if I cat /proc/meminfo I can see more in the SUnreclaim line.

QuoteReplyEditDelete

 

 

2008-01-25 11:14:42     Re: Memory issues...

Mike Frysinger (UNITED STATES)

Message: 50155    free does not reflect cached memory

 

you would need to look at /proc/meminfo and calculate based on buffers/cached

Attachments

    Outcomes