[Gambas-user] debugging a (apparent) memory leak
Benoît Minisini
gambas at ...1...
Tue Oct 29 03:27:40 CET 2013
Le 29/10/2013 02:20, Kevin Fishburne a écrit :
> I don't think it's always been like this, but when I sometimes forget to
> close the server app running on my physical server and it runs for a few
> days I notice gb3 is using all 8 GB of system RAM and several GB of the
> swap partition. There's nothing in the app (that I know of) that should
> ever be using that much memory, so it sounds like a memory leak.
>
> Is there a way, other than manually following the logic of the entire
> execution sequence, to identify what part of the code is continually
> sucking up more and more RAM?
>
> Also, other than the infamous GOSUB without a corresponding RETURN, what
> types of declarations or code logic should I look for if I do scan
> through the codebase? Red flags, in other words.
>
If you have a main loop somewhere, you can count the number of object
allocations at each loop, by using the Class.Count property:
Dim hClass As Class
For Each hClass In Classes
Print hClass.Name;;hClass.Count
Next
Then you can see which kind of object allocation grows indefinitely.
--
Benoît Minisini
More information about the User
mailing list