[haiku-bugs] Re: [Haiku] #3183: Memory leak using realloc functionality.

  • From: "Jixt" <trac@xxxxxxxxxxxx>
  • Date: Mon, 11 Jan 2010 09:49:30 -0000

#3183: Memory leak using realloc functionality.
----------------------------+-----------------------------------------------
  Reporter:  Jixt           |       Owner:  axeld        
      Type:  bug            |      Status:  reopened     
  Priority:  normal         |   Milestone:  R1           
 Component:  System/Kernel  |     Version:  R1/pre-alpha1
Resolution:                 |    Keywords:               
 Blockedby:                 |    Platform:  x86          
  Blocking:                 |  
----------------------------+-----------------------------------------------
Changes (by Jixt):

  * status:  closed => reopened
  * resolution:  fixed =>


Comment:

 I've tested it again and I see it is not fixed. There is no crash anymore,
 but CPU hits 90-100% and memory is not freed up immediately. Memory usage
 goes to maximum and stays like that until the test program is
 closed(ActivityMonitor is a good application to look at the CPU & Memory
 usage). This means it is not fixed.

 I looked at the source code and I see you are using parts of 'hoard'
 (scalable memory allocator (malloc replacement) for multithreaded
 applications). These parts are from a decade ago. I suggest to take a look
 at '/haiku/trunk/src/system/libroot/posix/malloc' to see if the problem
 can be fixed over there.

 Maybe this issue isn't big for you (which I understand), but if this is
 fixed it would speed up multithreaded applications. The kernel should
 release memory immediately when an application doesn't need it anymore.
 So other applications can use the freed up memory immediately. This is
 done in other OS's  like Linux, BSD (OSX), ...

 Please take a look at it.

 Btw.

 I've tested it on R1 alpha1 from 14 september 2009 on VMWare fusion (dual
 core).

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/3183#comment:5>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: