hard.GCAllocatedMemory

alfcen

Well-Known Member
Licensed User
Longtime User
I'm afraid I fail to understand hardware.GCAllocatedMemory (suppose the unit is Bytes).
All I'm trying to figure out is how much memory hardware.GCCollect releases.
This does not make sense:

m = hard.GCAllocatedMemory
hard.GCCollect
msgbox("All unused resources released" & " (" & m & " Bytes)."," Garbage Collection",cMsgBoxNone,cMsgBoxAsterisk)

Any ideas appreciated :-)
 
first collection: 1483820
next time: 1479508
and then: 1479252
it various, but is always in the order of 1.4 to 1.9MB
 
That makes sense, thanks Erel.
Is there any means of computing the released amount of Bytes?
 
Fair enough.
Thanks a lot for your fast attention (as you always do).
 
Sorry to bother again, Erel
>...and let it release memory automatically.
Does this mean that garbadge collection is automatically performed after a first use of hardware.GCCollect, say in App_Start, whenever B4PPC deems it necessary?

I have a hardware.GCCollect in App_Start and another before AppClose, while
the user can anytime clear using a menu.
 
Why are you so worried about Garbage Collection? One of the points about the .NET Framework is that memory is managed for you, and B4PPC is a .NET app. The GC collects unused objects in memory automatically and frees the memory. Except in certain instaces when you have acquired resources OUTSIDE the .NET environment (which is unlikely in B4PPC) you can just let the GC do its' thing.
 
Back
Top