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)
You have 1.4 mb of used memory.
The GC can only free unused memory.
When the memory reaches 1.9 mb (on your device) the GC automatically frees unused memory.
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.