1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Memory "sweeper" and shutdown scheluder programs needed

Discussion in 'All Other Software' started by BG-0, Jan 9, 2009.

Thread Status:
Not open for further replies.
Advertisement
  1. BG-0

    BG-0 Thread Starter

    Joined:
    Dec 31, 1969
    Messages:
    6,922
    So... I've been playing Hellgate London a lot lately and would like to clean up my memory after (or even while?) playing the game because it's what it is. Any recommendations? I've used several of these programs in the past with my previous computer but have forgotten about all of them. Also, as a wish, I'd like a program that only does what I need it to do, free unused memory. No all-in-one solutions, and preferably freeware, not shareware. This program is needed for my XP rig in my spec box.
    Next, a program for "work". I capture old VHS tapes for the local sports association thingy, then convert them (because the capturer is crap and craps any movie that's longer than 5 minutes, and I have to convert before I can burn them) and scan their covers and edit them to fit 12x12 cm CD covers. I would like to have the computer left to capture or burn a 2 hour movie before I leave for home, and shut down after that. I only need a timed operation, though having it automatically shutdown after the job is done (let's say CPU load goes under 35% for 5 mins as a rule to shutdown) would be a plus.

    Thanks for any suggestions!
     
  2. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    MaxMem is a freeware app I've found useful. Probably get a lot of debate about whether these are actually useful, and for most people they are not; they can even slow system performance. There are some situations where they are useful though. On those rare occasions, I run it then exit.

    For a timed shutdown you can use the shutdown.exe command. Easiest way is to create a shortcut to start it.
    Right click the Desktop, point to New, click Shortcut
    Enter %windir%\system32\shutdown.exe -f -r -t 7200 in the Type the location of the item: box and click Next >
    Name it 2 hour shutdown then click Finish
    The time is specified in seconds.
    Create another shortcut using %windir%\system32\shutdown.exe -a to easily abort the shutdown.

    You can add a comment using - c "comment" if you wish (127 character max).

    If the burning program can be set to exit when it's finished, you can just check every few minutes to see if it is still running, then shutdown when it exits.

    You can monitor CPU usage with the WMIC command (wmic cpu get LoadPercentage). It will return the CPU usage for each CPU/Core at the time it's executed, so on a multi core system you'd have to add each core value together to get a total, take several readings, and then average them over the 5 minute period. If you can force the burner to run on a specific CPU, you can just check that one CPU, but that would actually be harder to code.

    You can just use a loop, it doesn't add much of a load, but might be better to add a delay so it checks say twice every 10 minutes. When the total load drops below a specified limit, you them start your 5 minute window and check every few seconds and if the average load for the period is below your threshold, executes the shutdown command.

    Would take a bit of batch file math, not a beginners script assignment, but not too difficult.

    If you are running any Distributed Computing projects, like [email protected], [email protected], Prime95, etc., this won't work, as they will force the CPU to always report 100% usage.

    A scheduled defrag would prevent the shutdown until it completed, but this might be a good utility to let you start a defrag, and shutdown when it's done.

    WinXP doesn't include a sleep command, but ping can be used to simulate it. You can install the Windows 2003 Resource Kit which includes the sleep.exe utility, or just the sleep utility for that matter, but you have to download the entire Resource kit to get it, though if by "work" you mean an employer's PC, you'd need to get their permission to install the Resource Kit.

    Sleep could also be used as a timed delay for the shutdown command so the message window won't be displayed for the whole two hours. Sleep for two hours, then do a 30 second shutdown.

    HTH

    Jerry
     
  3. new tech guy

    new tech guy

    Joined:
    Mar 27, 2006
    Messages:
    5,178
    I was under the assumption that the memory management in windows was sufficent, provided its a modern windows os, 2k, xp, and vista have good ones but i thought pre 2k operating systems had a poor one and in reality the two managers will just conflict and undo what the other does. Kind of like having two defraggers running on a pc, they will always undo each other.
     
  4. BG-0

    BG-0 Thread Starter

    Joined:
    Dec 31, 1969
    Messages:
    6,922
    I've never created a single batch file so everything after the two first paragraphs is over my head. I would propably learn how to do it, but to save power worth about an hour of a laptop running it will waste to time the shutdown is just not worth the effort IMO :eek: Excuses for laziness ftw :] And the "work" laptop is running Vista Home Premium 32-bit, BTW.
     
  5. BG-0

    BG-0 Thread Starter

    Joined:
    Dec 31, 1969
    Messages:
    6,922
    About the Maxmem: I installed it, and it says 2048 (100% free), basically it ingores my other RAM stick? What could cause that?
     
  6. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Definitely not meant as a first time batch file. I'll have to see what I can come up with, something generic "If total CPU usage drops below X% for Y minutes, shutdown in Z seconds". Would be useful for doing a shutdown after a virus scan, defrag, or backup for instance.

    The shutdown command works the same on Vista. The Win2k3 Resource kit is also compatible, so the sleep command will also work.

    MaxMem seems OK on my system with 2 GiB of RAM but it may be limited to 2 GiB of RAM. It hasn't been updated since 2001, so I suspect that's the reason.
    I haven't tried this one, but as it's newer (March 2006) it may see all of your memory.

    @newtechguy: I agree, most of the time a tool like this is not needed, and if left running can actually slow your system down. There are a few situations where they can help though.
    In my case, I use MaxMem on an old WinXP system with only 256 MiB of RAM. Can't add more due to a damaged RAM slot. Sometimes a program (Firefox or IE usually, running a Java applet) will start using a lot of RAM, which means the system has to start using the swap file. Slows to a crawl when that happens. Running this tool can often free up enough memory so the swap file isn't needed, at least long enough for the program to finish whatever it is doing that needed a lot of RAM, or so I can exit other programs to free up RAM.

    Jerry
     
  7. new tech guy

    new tech guy

    Joined:
    Mar 27, 2006
    Messages:
    5,178
    Ok i see now, but how do you stop windows the manager from interfering with the 3rd party application? But i see your logic now.
     
  8. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Only way to stop them from conflicting is to not run them at the same time. I only run it when needed, then exit (or disable it if I think I might need it again).
    The "conflict" is when a program like MaxMem frees up memory that a program has allocated. It may not actually be using it at the moment, but when you bring the program back to the foreground, it will likely allocate the memory that was just freed. And may allocate it even when it's in the background. Some memory "cleaners" were constantly trying to free memory, so you could end up with programs spending as much time allocating memory as doing useful work.

    The thing I liked about MaxMem was it has 3 modes. You set the Normal and Periodic to low values (1-2%), and it won't do much. Periodic checks every 3 minutes, but does nothing if you have more free memory than the setting you've chosen. The aggressive mode is only activated every 30 minutes, or when you choose.

    In my situation the programs in the background seem happy to wait until they are in the foreground before trying to re-allocate memory, so whatever is hogging memory can finish, or, worse case, I can end task on it without waiting several minutes for it to respond.

    I just ran it on this system. Started with 731 MiB free, after running I had 880 MiB. Typed most of this reply in Firefox, and was still 840 MiB free. Alt+Tab through the 8 programs I have running, and in 10 seconds I'm back down to 778 MiB free as those programs re-allocated memory for them selves. Dropped to 738 MiB when I re-ran an install in a Virtual machine that I started when I first checked free RAM.
    While it did free up some RAM, having more free RAM isn't really a benefit in this case, as I still have plenty free. If I was down to zero and the system was using the swap file, that's when it can really help.

    In the case of a program that doesn't free it's memory when it exits, Windows will free it when needed (swaps it out if it thinks the program is still using it), which can slow down the start of another application. Running a tool like this after exiting such a program can free it right away. Probably takes just as much time, but the time is spent all at once "Freeing memory" now instead of "waiting for program X to load" a bit later, so it can seem to speed things up.

    Jerry
     
  9. new tech guy

    new tech guy

    Joined:
    Mar 27, 2006
    Messages:
    5,178
    Ok i understand now. Was just curious.
     
  10. Elvandil

    Elvandil

    Joined:
    Aug 1, 2003
    Messages:
    51,988
    Those memory managers are likely to cause more harm than good. Since they empty the memory and "clear" it, the data needs to be loaded from the hard drive again. Not only do they use CPU themselves, but they slow down the machine. Memory is there to be used. The more used, the better, and the less that has to be accessed from the drive.

    If you want to have empty memory, just take out a couple sticks.
     
  11. BG-0

    BG-0 Thread Starter

    Joined:
    Dec 31, 1969
    Messages:
    6,922
    Elvandil, I assume you've never played Hellgate London youself? It is such a wonderful game, using all of my 3.35 GB of RAM if run for long (3-5 hours, as it tries to "remember" everything I've done during the session) and starts taking the textures to the level of Quake II. Then it starts clipping parts off from enemy and weapon models (seeing a lonely demon body with no arms, legs and head and shooting at your from where its weapon was supposed to be was quite a suprise for the first time, as was seeing your weapon model reduced to only the weapon mods installed to it) This is a specific use, I know 99.5% of the time memory cleaners are useless. Also, restarting the game is sometimes not an option(there are running goals(kill 15 beasts, collect 5 weapon mods, kill 25 enemies using poison element, etc, that when completed, spawn you 3 random prize items), neither does it clean the memory thoroughly.
     
  12. BG-0

    BG-0 Thread Starter

    Joined:
    Dec 31, 1969
    Messages:
    6,922
    Gosh I hate this feeling. I've dreamt twice about posting the previous post, and just noticed that I yet haven't even seen the post I "replied" to... :(
     
  13. BG-0

    BG-0 Thread Starter

    Joined:
    Dec 31, 1969
    Messages:
    6,922
    Okay, interesting turn. The shutdown.exe, for some reason, didn't shut the laptop in the specified time :confused: Any reason it'd not work? I'll soon test with a 30 sec timer... Well, not too soon as there's still 1.5 hours of capturing to do with this film -.-
    BTW I also tested it before leaving with the 30 sec timer and it gave me a "windows will shut down within a minute" that I took for a sign as the shortcut working.
     
  14. TheOutcaste

    TheOutcaste

    Joined:
    Aug 7, 2007
    Messages:
    9,028
    Odd. You didn't by chance leave off the -F switch? That's needed to force processes to exit. Without it, if a process doesn't respond in a timely fashion it won't shutdown.
    I would expect you'd see a popup about a process not responding with an OK button to end, and a Cancel button to return to windows. Or if you get a prompt from a program, say to save a file before exiting, it won't shutdown, but again, you would see that.

    Might check the event viewer (application and system logs) to see if there are any messages around the time it was supposed to shutdown.

    Only time I've seen shutdown fail was when the system also would not shutdown from the Start menu.

    Jerry
     
  15. BG-0

    BG-0 Thread Starter

    Joined:
    Dec 31, 1969
    Messages:
    6,922
    I copied the code completely. Also, I tested with the 30 sec timer and 15 sec timer, it restarted the computer... I then tried without the -r, thinking you could've copied that from somewhere where one needed a restart (r for restart o_O) but it did nothing without it.
    I wasn't there to see it didn't shut down, another worker just said he shut the computer down 25 minutes after the time had passed...
     
  16. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Solved Memory sweeper
  1. radiatedbug
    Replies:
    3
    Views:
    107
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/788537

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice