Domanda

I've never messed with memory before besides using Memory Streams. But I recently downloaded a RAM Cleaner that "purges" memory. I'm very curious on how it works and what it does. I tried googling some things about memory cleaning and purging but it's not making too much sense to me. How does memory cleaning work? Where can I learn more about it? Is it performing some sort of garbage collection on processes?

È stato utile?

Soluzione

Maybe this API Function help you friend...This function was very useful for me because calling the EmptyWorkingSet/SetProcessWorkingSetSize is just a way to clean up before the OS does it.

I think This is C# syntax... Convert and try this in VB.net :

using System;
using System.Runtime.InteropServices;
using System.Diagnostics;

[DllImport("psapi.dll")]
public static extern bool EmptyWorkingSet(IntPtr hProcess);

    public void Clean()
    {
        // get handle to a process
        Process ThisProcess = Process.GetCurrentProcess();

        // empty as much as possible of its working set
        bool Result = EmptyWorkingSet(ThisProcess.Handle);

    }

ThisProcess.Handle is the Process's Handle of your program.

and also look this : MSDN Link

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top