Comment #2 on issue 176 by arunpereira: Obviously hefty memory leak
http://code.google.com/p/thelastripper/issues/detail?id=176
Well, I have started working on tracking down this memory leak. The issue
seems to originate within liblastrip and the LastManager class within the
LastManager.Save. The memory seems to be lost in the byte[]. I will see if
I can zero out the byte[] when the song is completed saving, returning the
memory to the OS.
Attached an image that includes a class reference image. The in-memory
saved data probably doesn't get gc'ed or does get marked for de-allocation
but doesn't. Will update when I have a fix for the issue. This seems like
the best place to start.
Attachments:
Callgraph-lastripper.png 41.1 KB
running version 1.4.0 and still seeing this bug, works fine for a few hours
then crashes. would be nice if I could leave it running overnight to use up
the cheap bandwidth :)
AFAIK proper memory disposal is impossible in C#, but you should still be
able to trick the OS into doing something about it using IDisposable; have
a look at:
http://stackoverflow.com/questions/1452096/c-how-to-implement-my-own-byte-array-creation-and-disposal
(if you haven't seen it already,) or try a colossal using block somewhere.
my system is just an XP VM with about a Gig of RAM sliced from my Mac; so I
am insulated from the particularly painful system instabilities that you
get when this bug strikes.
I have tried getting it to write to disk rather than buffer in RAM, but
then it just crashes as soon as it starts streaming, sadly. This would in
theory solve the problem.
I don't have time to look into a proper fix at the moment, but if it is
still unresolved in January I might take a look.
It's probably still unresolved in January... But I'll happily grant you svn
commit access if you want to hack on it... I don't have time for hacking
TheLastRipper anymore...