project-navigation
Personal tools

Author Topic: CPU problem while playing  (Read 19495 times)

Offline EchizenR

  • Squad Leader
  • ****
  • Posts: 103
    • View Profile
CPU problem while playing
« on: June 12, 2008, 11:59:35 am »
I'm using Win XP on a laptop, and after playing UFO: AI for a while, the CPU tends to become very laggy. Usually CPU activity is reflected by a light next to the power indicator. But after playing for a while, the light does not light up, and the computer freezes for intervals before resuming and the cycle continues. May I know how to I solve this?

Offline BAM

  • Rookie
  • ***
  • Posts: 79
    • View Profile
Re: CPU problem while playing
« Reply #1 on: June 12, 2008, 04:32:03 pm »
I've never heard of a CPU light, possibly the hard disk light? If so, you may have a developing problem...

Offline EchizenR

  • Squad Leader
  • ****
  • Posts: 103
    • View Profile
Re: CPU problem while playing
« Reply #2 on: June 14, 2008, 11:41:51 am »
Pardon my mistake. Yeah, its the HDD light. But what kind of problem? Would my CPU crash if I continue playing?

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2560
    • View Profile
Re: CPU problem while playing
« Reply #3 on: June 14, 2008, 07:41:27 pm »
How much memory do you have? If just little the system will try to compensate by swapping. This cause high CPU and HDD activity, and slowdown (lagging).

 I have 1G and ufoai used 71%-of it (2.3-dev version, on linux, according to top)

-geever

Offline EchizenR

  • Squad Leader
  • ****
  • Posts: 103
    • View Profile
Re: CPU problem while playing
« Reply #4 on: June 15, 2008, 05:27:40 pm »
I have a 1.79 Ghz processor and 384 of RAM. Not sure how much does AI take up during gameplay, but most of the time its smooth with occasional lags. However, as I play for long periods of time, say over 1 hour, performance gradually deteriorates.

Offline Falion

  • Rookie
  • ***
  • Posts: 70
    • View Profile
Re: CPU problem while playing
« Reply #5 on: June 15, 2008, 06:38:40 pm »
384 meg of Ram? Dang...thats a LOT of your problem...XP needs a minimum of 512 meg just to run fairly decently. With so little system ram left over after running the OS, there isn't much left for gaming. Which is why your getting occasional lags...

As you play...your system is having to switch back and forth from ram, to "virtual memory"  ( your paging file ) on your hard-drive...which over playing time is a good bet why your performance degrades.

Try installing a 1 gig ram module or more if possible...you'll see an immediate difference. Many people when getting a PC are looking at the processor speed...while important...if you have very little system ram, it's like putting the CPU in a mind vise...it just can't process very effectively :)

Offline BAM

  • Rookie
  • ***
  • Posts: 79
    • View Profile
Re: CPU problem while playing
« Reply #6 on: June 16, 2008, 02:06:38 am »
I'd say you need 512MB if not a gigabyte for occaisional gaming (anything not so huge). Although I've been on decently-running XPs with 128MB, they were only for typing, etc.

Offline EchizenR

  • Squad Leader
  • ****
  • Posts: 103
    • View Profile
Re: CPU problem while playing
« Reply #7 on: June 16, 2008, 03:18:30 am »
Thanks. Is there a way to lessen this switching? I don't understand how this makes my CPU slower, but is there any way to change some settings and alleviate the problem?
« Last Edit: June 16, 2008, 06:25:24 am by EchizenR »

Offline blondandy

  • Sergeant
  • *****
  • Posts: 391
    • View Profile
Re: CPU problem while playing
« Reply #8 on: June 16, 2008, 09:09:59 am »
apart from upgrading your memory, i do not think you can lessen switching.

512Mb DIMMs are not so expensive these days. (I guess you could have more of a problem if your motherboard is so old that it cannot take it)

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: CPU problem while playing
« Reply #9 on: June 16, 2008, 01:03:22 pm »
I don't understand how this makes my CPU slower

It doesn't, technically. Your CPU will still process instructions at the same speed. However, the CPU needs data to work with. This data is stored in the processor's cache. This is a small amount of very fast memory located very close to the CPU. The data in the cache comes from RAM. Moving it from RAM to the cache takes time, but it's fairly fast. If you don't have enough RAM to store all the data the game uses, it's stored in the swap file, on the hard disk. If the CPU needs data that happens to be swapped out, that data first needs to swap with some other data in RAM and then be transferred to the cache. This takes a very long time, in terms of clock cycles.

So basically, when your computer is swapping your CPU is just waiting for it to complete. Your CPU doesn't get slower, but it can't process at maximum efficiency because it's not getting the data fast enough.

Offline Falion

  • Rookie
  • ***
  • Posts: 70
    • View Profile
Re: CPU problem while playing
« Reply #10 on: June 16, 2008, 06:04:06 pm »
BT is 100% accurate, I guess I did not explain it completely in my last post. When your PC lacks adequate RAM, it cannot process information at an optimum level. RAM works VERY fast, in terms of Nanoseconds, so when your CPU needs data, and that data is brought from your Hard-Drive into RAM, it can be accessed fairly quickly. The CPU may be the fastest made, but if it can't get the data it needs to it quickly...well your CPU is SOL, until the data arrives.

If you don't have enough system RAM, this data the CPU needs is instead 'stored' in what is called "virtual memory". This is a "space" allocated on your HARD-DRIVE to hold the data the CPU needs until it can be moved into RAM, and then the CPU's cache as needed. So...essentially the virtual memory, or "page file" in your Windows OS is acting as RAM, but it works somewhere in the area of milliseconds, instead of nanoseconds...which is an eternity in terms of a speed difference in computer terms. Hard-Drives  ( where the OS page file is located at ) are extremely SLOW in data throughput, compared to RAM. Hence, LAG, or even a system lockup, as if your PC runs completely out of RAM and Pagefile, your OS can find itself... with no room left for itself to operate in and your PC can crash or lock up.

Some games can do this, and you'll hear about things like "memory leaks", which is basically a way of saying over time, the program is leaving no room left for the OS and you get a CTD ( crash to desktop ) or some similar type of thing.

Most bargain brand, or off the store "shelf" PC's are very LIGHT in system ram, and "many" are not really designed with gaming in mind. A good rule of thumb, is 2 Gigs of system ram for XP and even MORE for Vista, for things to run really well when gaming. The more intense your gaming...the more RAM you need !! Same rule applies to any Vid-Cards...generally the more RAM on the PCB the better off you will be. I know with your situation and a laptop...Vid-Cards don't really apply...just mentioning it. :)

LOL...I can't program or model a single thing, but make PC's I can do, and have been for over a decade now...sure beats buying store bought stuff :)

« Last Edit: June 16, 2008, 06:47:26 pm by Falion »

Offline DanielOR

  • Squad Leader
  • ****
  • Posts: 238
    • View Profile
Re: CPU problem while playing
« Reply #11 on: June 17, 2008, 09:00:01 pm »
This seems like a good place to ask the wizards...

XP, 1.8 GHz, 512 RAM.  Lately the system has developed a memory leak.  Game freezes ocasionally.  One time I saw it hit 460MB of virtual memory - UFO:AI alone.  Now, the problem, I believe, is not limited to UFO:AI.  After a few days IExplorer got to bee 210MB of virtual memory too.  If I close things, the game runs fine (did last time), but it doea hang if I run it concurently with other things like firefox or explorer.

So, I suspect the problem is with the system.  Before you ask: firewall is on, McAfee is updated and running, spybot used regularly, and comes up clean.  The resident tray is pretty empty aside from the McAffee and SpyBot.

Question: any recommendations on fixing memory leak other than reinstalling windows?  Been a year and a half since I formatted the drive. 

Offline blondandy

  • Sergeant
  • *****
  • Posts: 391
    • View Profile
Re: CPU problem while playing
« Reply #12 on: June 17, 2008, 09:02:50 pm »
A memory leak is a bug specific to a piece of software. It keeps allocating and never frees.

Offline Falion

  • Rookie
  • ***
  • Posts: 70
    • View Profile
Re: CPU problem while playing
« Reply #13 on: June 17, 2008, 09:40:37 pm »
Like Andy said, your system cannot have a memory leak...that's basically impossible. A memory leak is the result of sloppy, or somehow "wrong" coding in some type of software / program / game. When running a program that has such a "bug" if you want to call it that...it just keeps using up more and more system resources / Ram until it crowds out, or  "possibly" even over-writes the area your Operating system needs to function...then you crash, lock up, BSOD or some similar situation happens.

Reformatting is "always" good, if you have everything backed up, and can spend the time doing so. Make sure you have your mobo ( motherboard ) drivers CD to reinstall all of those and if not...download them from your MOBO's manufacturer's website.

Try using these free programs before doing so...they might pick up some stuff that's slowing your system down.

http://www.filehippo.com/download_ccleaner/

I've used the above program now for over 3 years...no ill effects. Make sure, the link your downloading from is the on the "right" over in the green area where it says "Download latest Version" under the green arrow. I once told my Dad to get this program and he tried to download off a link to some "pay" program on the left side. He tried 4 times and later told me that this program wasn't free LOL :)

http://www.emsisoft.com/en/software/free/

I find spybot search & destroy isn't up to snuff as it once was...the above program updates almost daily with a new malware / addware / trojan database for the latest threats out there. For a free program it's a pretty good spyware removal tool.

Stop using Internet Destroyer ( ahem...IE ) and use Firefox, or another open source browser...you'll save yourself a TON of grief...to get it go here...http://www.mozilla.com/en-US/firefox/

When your McAffee subscription runs out...if you switch over to Firefox, you can get by easily with either of these 2 free AV programs...and they use much less system resources than your current AV program. I happen to like Avast ( now that it's up to 4.8 ) better...but both are good. Make sure to uninstall McAffee...

http://www.avast.com/     Look for the free home edition !


http://free.grisoft.com/    Again...it's free :)

There are better AV's out there, but you have to pay for them...and most are resource hungry and bog your system down. These 2 are pretty light on resources...you can even use them BOTH together, even though it's not recommended.

Lastly...please get yourself some MORE ram...512 ram for any gaming is like basement level minimum...and RAM is dang cheap...go here...http://www.newegg.com/Index.aspx?Name=Home  to get just about any thing you might need :)

Once you get your ram ( however much ) and install it, manually set your page file to zero...restart your computer...then reset the page file to double the amount of ram you have installed and reboot once again.

 If you have 1 gig of ram set the page file to 2 gigs...2 gigs of ram...set it to 4 gigs...that would be 4000 Megs. Your page file will now stay the same, never defrag...and Windows won't waste it's time resizing it all the time, which usually improves your gaming perfomance...usually.

There are more things I could tell you, but they involve messing around / tweaking the XP OS...try the stuff above and see what your results are :)
« Last Edit: June 18, 2008, 12:55:17 am by Falion »

Offline BTAxis

  • Administrator
  • PHALANX Commander
  • *******
  • Posts: 2607
    • View Profile
Re: CPU problem while playing
« Reply #14 on: June 17, 2008, 10:03:15 pm »
Overwriting memory space used by the OS should in theory not be possible - the OS manages memory, so if it allows a program to write memory addresses that it knows it's using itself, it's a bad OS.

Then again, Windows IS a bad OS. But even so.