Digital Art Zone

 
   
2 of 2
2
Anyone Know of Free Software to Release Memory?
Posted: 10 October 2012 08:19 AM   [ Ignore ]   [ # 16 ]
New Member
Total Posts:  3
Joined  2008-07-11

A free memory cleaner for windows is simple.

All the magic happens in 1 single WinApi call(C# interop):

[DllImport(“psapi”)]
private static extern bool EmptyWorkingSet(IntPtr hProcess);

so all you have to do is:
(C# code)

internal class Program
  {
      [DllImport(“psapi”)]
      private static extern bool EmptyWorkingSet(IntPtr hProcess);

      private static void Main(string[] args)
      {
        Clean();

        //if u dont want the console to auto close uncomment this line
        //Console.ReadLine();
      }

      private static void Clean()
      {
        Process[] processes = Process.GetProcesses();
        foreach (Process current in
          from proc in processes
          where proc.ProcessName != “System” && proc.ProcessName != “Idle” && proc.ProcessName != “audiodg”
          select proc)
        {
          try
          {
              EmptyWorkingSet(current.Handle);
          }
          catch (Exception ex)
          {
              //uncomment these lines if u want the errors to be posted in the console

              //Console.WriteLine(ex.Message);
          }
        }
      }
  }


————————————————————————————————-

So u can download the file here
included in the 7zip file are:
* a pre-compiled exe
* full source code (c# .net/visual studio 2010/.net 4.0)

Profile
 
 
Posted: 10 October 2012 08:37 AM   [ Ignore ]   [ # 17 ]
Addict
Avatar
RankRankRankRank
Total Posts:  8514
Joined  2009-07-13

confused

 Signature 

WARNING do not click tongue rolleye what video horrors will be seen if you do cannot be unseen.
my render thread
        never forget
A Drows Walk
Jaderail is at it again

Profile
 
 
Posted: 17 October 2012 12:34 PM   [ Ignore ]   [ # 18 ]
Member
Avatar
Rank
Total Posts:  137
Joined  2008-11-04
mjc1016 - 09 October 2012 06:02 PM

And most importantly…for Windows reboot, at least every 48 hrs…if not daily.  Unless you are running a super lean, clean install that seldom, if ever connects to the Internet, Windows just isn’t robust enough to go very long without restarting.

Of course, if you really want to maximise memory usage/efficiency…get Linux.

Ahhh, for the days of OS/2 - when you could run a server for years without rebooting…

 Signature 

“We probably wouldn’t worry about what people think of us if we could know how seldom they do.”
Mark Twain

Profile
 
 
Posted: 17 October 2012 01:03 PM   [ Ignore ]   [ # 19 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  15815
Joined  2003-10-09

Shortened the separator line to restore formatting.

 Signature 

DAZ Studio Frequently Asked Questions

Index of free DAZ Studio scripts and plugins list

Profile
 
 
Posted: 17 October 2012 01:13 PM   [ Ignore ]   [ # 20 ]
Addict
Avatar
RankRankRankRank
Total Posts:  4524
Joined  2007-09-13
cjreynolds - 17 October 2012 12:34 PM
mjc1016 - 09 October 2012 06:02 PM

And most importantly…for Windows reboot, at least every 48 hrs…if not daily.  Unless you are running a super lean, clean install that seldom, if ever connects to the Internet, Windows just isn’t robust enough to go very long without restarting.

Of course, if you really want to maximise memory usage/efficiency…get Linux.

Ahhh, for the days of OS/2 - when you could run a server for years without rebooting…

Yeah…when you did it was to make sure the power switch was still working and not all gummed up…and clean out the inevitable dust monsters (because by that time the bunnies mutated)

 Signature 

1432 old posts

My ShareCG gallery.

Just because something costs a lot, doesn’t mean it’s the best…

It just means it’s expensive.

Profile
 
 
Posted: 17 October 2012 01:42 PM   [ Ignore ]   [ # 21 ]
Addict
Avatar
RankRankRankRank
Total Posts:  8514
Joined  2009-07-13

I find lately I need to always reboot after a long render of more than 24hours or things start corrupting
particulary if I have been online too.
does anyone else find after Windows downloads updates, even if you have the automatic option off, things start misbehaving untill you install the blighters and reboot!!

 Signature 

WARNING do not click tongue rolleye what video horrors will be seen if you do cannot be unseen.
my render thread
        never forget
A Drows Walk
Jaderail is at it again

Profile
 
 
Posted: 17 October 2012 01:53 PM   [ Ignore ]   [ # 22 ]
Active Member
Avatar
RankRank
Total Posts:  998
Joined  2007-04-08
wendy♥catz - 17 October 2012 01:42 PM

I find lately I need to always reboot after a long render of more than 24hours or things start corrupting
particulary if I have been online too.
does anyone else find after Windows downloads updates, even if you have the automatic option off, things start misbehaving untill you install the blighters and reboot!!

*raises hand*

I miss Linux!  But I hate Linux!

 Signature 

You’re never too old for metaballs!  ~Michael Frank

Profile
 
 
Posted: 17 October 2012 08:25 PM   [ Ignore ]   [ # 23 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  9726
Joined  2007-11-06

Other than when installing things that require it, I seldom reboot any of my Windows computers.

 Signature 

PostgreSQL CMS FAQ
Tutorial: Adding Surfaces in DS
Product Updates: Non-Genesis/G2 DIM Zips
Non-Genesis Items with Metadata
Updated Genesis Products

Profile
 
 
   
2 of 2
2