BUG: CPU & Memory Usage (RC2-PR)

An archive for tracking bugs that have already been fixed
User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

BUG: CPU & Memory Usage (RC2-PR)

Post by Omnidon » Sun Jul 16, 2006 8:58 am

3.4 GHz Pentium 4 Processor
Windows XP Pro
ATI Radeon X300 Graphics Card
1 GB of RAM

While idling with no connections and nothing on the map, BRPG RC1 uses about 15% of my processor.

While similarly idling, BRPG RC2-PR uses about 80% of my processor.
Last edited by Omnidon on Thu Aug 10, 2006 11:40 pm, edited 2 times in total.

User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

Post by Omnidon » Tue Jul 18, 2006 11:58 am

Also...

RC1 uses 27 MB
whereas
RC2-PR uses 193 MB of RAM

It's making it quite difficult for me to test multiplayer, since two instances of RC2-PR makes my computer very sluggish.

User avatar
heruca
Developer
Posts: 9382
Joined: Sun Nov 20, 2005 11:58 pm
Location: Buenos Aires, Argentina
Contact:

Post by heruca » Tue Jul 18, 2006 2:07 pm

Are you getting those results with the same map loaded in both versions?
:arrow: Please help spread the word about BRPG and BGE, and never hesitate to tell me how I can make them better suit your gaming needs.

User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

Post by Omnidon » Tue Jul 18, 2006 7:47 pm

yes, all I do is boot up and I get that on the default grass map. There must be some sort of memory loop in the new scripting or something.

User avatar
heruca
Developer
Posts: 9382
Joined: Sun Nov 20, 2005 11:58 pm
Location: Buenos Aires, Argentina
Contact:

Post by heruca » Thu Jul 20, 2006 5:17 am

Possibly fixed.

How do you test CPU usage on Windows? I'd like to confirm that my recent attempt to reduce CPU usage actually did something.
:arrow: Please help spread the word about BRPG and BGE, and never hesitate to tell me how I can make them better suit your gaming needs.

User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

Post by Omnidon » Thu Jul 20, 2006 11:00 am

Open the Task Manager (CTRL+ALT+DELETE).

It will show the CPU & Memory usage for all running processes.

User avatar
Dormouse
General
Posts: 239
Joined: Sun Dec 18, 2005 9:18 am

Post by Dormouse » Thu Jul 20, 2006 11:52 am

heruca wrote:Possibly fixed.

How do you test CPU usage on Windows? I'd like to confirm that my recent attempt to reduce CPU usage actually did something.
I mostly use Process Explorer (www.sysinternals.com)

Creators have just been poached by Microsoft.

User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

Post by Omnidon » Thu Jul 20, 2006 12:09 pm

Well, I usually use WinTasks by Uniblue.

But the built-in Windows Task Manager will work fine for this.

User avatar
Dormouse
General
Posts: 239
Joined: Sun Dec 18, 2005 9:18 am

Post by Dormouse » Thu Jul 20, 2006 3:07 pm

Process Explorer is free.

User avatar
heruca
Developer
Posts: 9382
Joined: Sun Nov 20, 2005 11:58 pm
Location: Buenos Aires, Argentina
Contact:

Post by heruca » Thu Jul 20, 2006 3:17 pm

Thanks, guys.
:arrow: Please help spread the word about BRPG and BGE, and never hesitate to tell me how I can make them better suit your gaming needs.

User avatar
heruca
Developer
Posts: 9382
Joined: Sun Nov 20, 2005 11:58 pm
Location: Buenos Aires, Argentina
Contact:

Post by heruca » Wed Jul 26, 2006 1:58 pm

Looks like this is not a bug after all, just normal behavior for Director.

See here:
http://www.adobe.com/cfusion/knowledgeb ... id=tn_8151
It is important to distinguish between hogging CPU cycles (preventing other applications from getting time or events) and soaking up idle cycles. Director does not monopolize the processor while it is running, it merely uses the processor at all times when other applications do not require it. If you have another application running at the same time as Director, you will find that the other application is still responsive although the CPU meter is at 100 percent.

When the CPU meter is at maximum the sum of all applications' processor usage is 100 percent. A maximum reading does not mean that Director alone is using 100 percent of the CPU. For example, if other applications require 37 percent of the processor time, Director will only use the remaining 63 percent.
In any case, I've added an INI file that should help lower CPU usage, whether BRPG is in the active app or in the background/minimized.
:arrow: Please help spread the word about BRPG and BGE, and never hesitate to tell me how I can make them better suit your gaming needs.

User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

Post by Omnidon » Wed Jul 26, 2006 3:43 pm

heruca wrote:Looks like this is not a bug after all, just normal behavior for Director.

See here:
http://www.adobe.com/cfusion/knowledgeb ... id=tn_8151
It is important to distinguish between hogging CPU cycles (preventing other applications from getting time or events) and soaking up idle cycles. Director does not monopolize the processor while it is running, it merely uses the processor at all times when other applications do not require it. If you have another application running at the same time as Director, you will find that the other application is still responsive although the CPU meter is at 100 percent.

When the CPU meter is at maximum the sum of all applications' processor usage is 100 percent. A maximum reading does not mean that Director alone is using 100 percent of the CPU. For example, if other applications require 37 percent of the processor time, Director will only use the remaining 63 percent.
In any case, I've added an INI file that should help lower CPU usage, whether BRPG is in the active app or in the background/minimized.
Erm not really. If that was true, then it would've happened in RC1 and all the earlier versions. I've only had this in RC2-PR.

Also, it is not 'leaving' the processor time open to other programs, it is severely lagging my system.
There is clearly something you added to the code in RC2-PR that is bugged and causing a memory-loop or somesuch.

This is not a minor thing and merely tweaking the overall performance a bit will probably not help. It is almost certainly one little piece of buggy code somewhere in the new features causing it.

I was planning on adding this one to my post in the 'most critical bugs' thread if its not fixed by RC2 public.

User avatar
heruca
Developer
Posts: 9382
Joined: Sun Nov 20, 2005 11:58 pm
Location: Buenos Aires, Argentina
Contact:

Post by heruca » Wed Jul 26, 2006 3:50 pm

In RC2(PR) there was a severe lag issue in multiplayer games when units were dragged with snap-to-grid turned off, but I've fixed that, as noted in the relevant bug thread. Is that the lag you're referring to?

I've also taken other steps to reduce CPU usage. I now get anywhere from 10-25%. Nowhere near 90-100%, as before.
:arrow: Please help spread the word about BRPG and BGE, and never hesitate to tell me how I can make them better suit your gaming needs.

User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

Post by Omnidon » Wed Jul 26, 2006 4:07 pm

heruca wrote:In RC2(PR) there was a severe lag issue in multiplayer games when units were dragged with snap-to-grid turned off, but I've fixed that, as noted in the relevant bug thread. Is that the lag you're referring to?
Nope, as mentioned earlier, it would happen no matter what the circumstances were. I could boot up a fresh RC2-PR installation and, without even touching anything, it would use most of my processor and memory.
heruca wrote:I've also taken other steps to reduce CPU usage. I now get anywhere from 10-25%. Nowhere near 90-100%, as before.
Ah, you made it sound like you were doing minor tweaks, but that's a drastic difference. If that's the case, then this is fixed. :)

User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

Post by Omnidon » Sun Jul 30, 2006 6:53 pm

RC2 Public:

CPU usage is now minimal :)

Memory usage is still quite high (181 MB)
whereas RC1 was 27 MB...
I haven't noticed any problems with that yet since I have 1 GB memory, but it might put a strain on older computers.

I noticed an interesting thing with the memory; if I open a second instance of BRPG, the first instance will drop in memory usage to around 50-70 MB while the second instance takes over the 180 MB.

Closing the second instance will leave the first one at the reduced memory.

EDIT: I just connected the two instances with nothing added. The second instance is using 36% of my CPU while the first instance is still at zero. No problems yet though.
Last edited by Omnidon on Sun Jul 30, 2006 7:01 pm, edited 1 time in total.

User avatar
heruca
Developer
Posts: 9382
Joined: Sun Nov 20, 2005 11:58 pm
Location: Buenos Aires, Argentina
Contact:

Post by heruca » Sun Jul 30, 2006 7:01 pm

I think some of that is virtual memory (uses a temporary swap file on the hard disk), and is released when needed elsewhere. Director apps tend to play well with other apps running, too.
:arrow: Please help spread the word about BRPG and BGE, and never hesitate to tell me how I can make them better suit your gaming needs.

User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

Post by Omnidon » Sun Jul 30, 2006 7:54 pm

Omnidon wrote:EDIT: I just connected the two instances with nothing added. The second instance is using 36% of my CPU while the first instance is still at zero. No problems yet though.
The CPU usage in the second instance jumped to 80 as soon as I placed a single unit and stayed there.

User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

Post by Omnidon » Sun Jul 30, 2006 8:34 pm

This time when I loaded two instances, they both used 180 MB of memory and things (especially the sound effects) started to get a bit sluggish.
heruca wrote:Two instances running on one CPU sounds like an ideal candidate for lowering the SleepTime setting in the INI file.

Try it and let me know if it helps.
The CPU usage still skyrockets on the player client as soon as I place a unit in an online game.
Setting the sleeptime down to 50 might have knocked a couple of % off, but not enough to make a noticable difference.

EDIT: Tried setting sleeptime down to 5 on the player client, still no real effect.

User avatar
heruca
Developer
Posts: 9382
Joined: Sun Nov 20, 2005 11:58 pm
Location: Buenos Aires, Argentina
Contact:

Post by heruca » Sun Jul 30, 2006 9:04 pm

Actually, if you're trying to cut down the CPU usage, you should be raising the SleepTime setting, not lowering it. Try 300 or 400, if that doesn't block your connections.
:arrow: Please help spread the word about BRPG and BGE, and never hesitate to tell me how I can make them better suit your gaming needs.

User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

Post by Omnidon » Mon Jul 31, 2006 12:34 am

heruca wrote:Two instances running on one CPU sounds like an ideal candidate for lowering the SleepTime setting in the INI file.
heruca wrote:Actually, if you're trying to cut down the CPU usage, you should be raising the SleepTime setting, not lowering it. Try 300 or 400, if that doesn't block your connections.
:P

Anyway, tried it at 400.
It seems to have dropped it by %10, but that still leaves it at around 70% CPU usage after a unit has been placed in an online session.

I just got my player to download BRPG.
He's having the same 180 MB of memory usage. We'll try online in a bit.

User avatar
Dormouse
General
Posts: 239
Joined: Sun Dec 18, 2005 9:18 am

Post by Dormouse » Mon Jul 31, 2006 12:39 am

Omnidon wrote:I just got my player to download BRPG.
He's having the same 180 MB of memory usage. We'll try online in a bit.
My memory usage has varied. Not kept an eye on it most of the time, but have seen it at 220 MB, and then a few minutes later below 10 MB.

Not seen CPU usage high at all.

User avatar
heruca
Developer
Posts: 9382
Joined: Sun Nov 20, 2005 11:58 pm
Location: Buenos Aires, Argentina
Contact:

Post by heruca » Mon Jul 31, 2006 1:21 am

Omnidon, I'll have a look to see if something is causing a spike in CPU usage when one or more units are deployed.

But the real question is: is your system sluggish in the least, or are you just concerned by the readout of the CPU monitor?
:arrow: Please help spread the word about BRPG and BGE, and never hesitate to tell me how I can make them better suit your gaming needs.

User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

Post by Omnidon » Mon Jul 31, 2006 1:57 am

Omnidon wrote:This time when I loaded two instances, they both used 180 MB of memory and things (especially the sound effects) started to get a bit sluggish.
:P

Both instances have been using 180 MB memory consistently now, and that certainly makes it a bit sluggish, even though I supposedly have 1 GB available.

Because of that, it's hard to know whether the CPU usage is also contributing.

User avatar
heruca
Developer
Posts: 9382
Joined: Sun Nov 20, 2005 11:58 pm
Location: Buenos Aires, Argentina
Contact:

Post by heruca » Mon Jul 31, 2006 2:27 am

OK, what would you like me to limit the map size to? 30x30? :P
:arrow: Please help spread the word about BRPG and BGE, and never hesitate to tell me how I can make them better suit your gaming needs.

User avatar
Omnidon
Site Admin
Posts: 2186
Joined: Mon Feb 06, 2006 7:46 pm
Location: NY State, USA
Contact:

Post by Omnidon » Mon Jul 31, 2006 4:34 am

RC1 had 40x40 cells.
RC2 has 100x100 cells.

That's a 250% increase.

RC1 used 27 MB of memory.
RC2 uses 180 MB of memory.

That's a 666% increase. :twisted:

My point is there must be something else adding to the equation.
Last edited by Omnidon on Mon Jul 31, 2006 4:40 am, edited 2 times in total.

Locked

Who is online

Users browsing this forum: No registered users and 2 guests