how to free memory in when system show low memory.
how to relese memory in from system memory dump in .

Recommended Answers

All 2 Replies


The following code will trigger the garbage collector (that is actually what it is called) to "clean" the system memory of any disposed or redundant objects


I usually use this if I'm doing a series of complex code inside a loop like this:

dim iCount as integer =0

For each Widget in MyWidgets
        iCount = iCount + 1
        If (iCount Mod 100 = 0) Then
        End If
'..... do loads of complex stuff and functions here on my "Widget" object

This should free up some memory, other than that go through your code and see if you can be more efficient when it comes to memory use.

One common area that gets abused is scope. Keep the scope for your objects as short as possible so that they gets disposed of more often.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.