andremussche / scalemm

Fast scaling memory manager for Delphi
https://code.google.com/p/scalemm/
Other
98 stars 22 forks source link

Memory leaking due to fragmentation? #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am running Delphi XE2 x32 application under Windows 7 x64 Ultimate. It uses a 
lot of multithreading and is quite CPU/RAM intensive. When it runs for an 
extended period of time, I notice that it slowly consumes more and more RAM. 
This does not happen when I use native Delphi memory manager, so I assume I 
don't have any own leaks (like created, but not deleted objects, etc.). It 
happens only when I use ScaleMM 2.4.1. I am fighting with this issue already 
for some time, I tried different solutions. Firstly, I thought that if I delete 
and recreate my threads from time to time (normally I create them only once and 
then use a pool of threads) it would help, because when the tread is destroyed, 
it will delete all its objects and free the memory. It didn't help, though, the 
memory is still leaking. Is there any method that can prove that this leakage 
is caused by ScaleMM, especially by fragmentation? Is there any way to to a 
"defragmentation"? Is there anything at all that can be done? Honestly, I don't 
want to go back to the default Delphi memory manager since with ScaleMM my 
application runs 4-5 times faster.

Thank you!

Original issue reported on code.google.com by acetyla...@nanoweb.info on 23 Feb 2014 at 1:51

GoogleCodeExporter commented 9 years ago
thanks for the report, but I'm afraid it won't be easily possible right now.
So I think I should try to make some usage report per thread and then see where 
it comes from

Original comment by andre.mussche on 24 Feb 2014 at 7:09

GoogleCodeExporter commented 9 years ago
Sorry for the off-topic, just want to say thank you for your great work, which 
I admire. As I mentioned already, ScaleMM is tremendously fast - with ScaleMM, 
on my machine with my application I can process about 60000 data elements per 
second instead of 12000 when using standard Delphi memory manager. If this is 
not impressive, I don't know what is! Please keep up your work on ScaleMM!

Thank you!

Original comment by acetyla...@nanoweb.info on 24 Feb 2014 at 5:15

rfrezino commented 8 years ago

I had the same problem, its really a pity. Yes, you are right, its memory fragmentation. Its really not a easy problem to solve. Itll be necessary almost a full GC stuff to be able to defrag the memory. :/