Author Topic: MSHTA,EXE at 100% CPU  (Read 7311 times)

CruiseLite

  • Newbie
  • *
  • Posts: 43
    • View Profile
MSHTA,EXE at 100% CPU
« on: May 02, 2010, 03:29:26 PM »
Wondering if anyone else is seeing the above problem? I first starting noticing it several weeks ago.
I'm running TD for my tournaments on a Lenovo Y510 laptop with a Pentium dual core T2330, 4 GB RAM.
This was an Windows XP Pro SP3 environment until recently when I did a clean install of Windows 7 Pro.
I also run TD on my desktop in a Suse Linux 11.2 hosted Windows XP SP3 VirtualBox machine.
I've ran this combo for some time without incident until recently.

Now I'm seeing the TD screen just hang and the clock stop counting.
The problem is sporadic and since I'm seeing it on both machines I'm inclined to think it's related to some MS update I've applied but I'm not really sure.

Today I was trying to dig into it a little deeper and what I've noticed on my desktop is that if I cycle through the various screens using the function keys then the CPU usage drops to 15-20 % overall and ~10% for the mshta.exe process on all the screens except the regular tournament screen. Once I hit F2 then the CPU usage jumps up 100% overall and 75-95% for mshta.exe. At this point the tournament clock either runs really slow stops for 5-10 seconds at a time (or longer).

Not really sure what to try to do to fix the problem. Some of the Google searches for mshta.exe suggested changing the priority for the process from Normal to Realtime but I've tried changing to Realtime and Low but it did not seem to help any.

Any thoughts or suggestions out there?

Thanks!

Cruiselite

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5423
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #1 on: May 03, 2010, 11:19:55 AM »
I've seen something similar with the currently-in-test 2.6 version of the software.  Unfortunately, it is inconsistent and I can't nail it down to a specific version of IE or Windows or Windows Script.  With all of the patches Microsoft does to Windows and IE, it could be any number of combinations of IE, IE patches, Windows, or even your video drivers.

The difference between the Tournament screen and the other built-in screens is that the Tournament screen is continuously updated.  The software does a fairly good job of caching what it can and only updating what is necessary, but that still leaves a number of items that will get updated at least once per second.  That should NOT be a big deal to a modern PC, but I suspect there's some odd version of IE out there that does not handle the constant updates very well.  Of course, without any real evidence this is all complete speculation.

My only suggestion would be to try to update or roll-back IE.  You may even try uninstalling IE and then re-installing it, if Windows 7 will let you do that.  I guess if I were doing this my goal would be to see what exact version of IE you have now (should be on the IE About dialog), and try to get to an earlier or later version of IE.  And simply see if that makes any difference at all.

CruiseLite

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #2 on: May 08, 2010, 03:50:08 PM »
Thanks Corey,

Any info is appreciated. I can certainly agree about it being a multitude of possible combinations.

My IE version is:
Version: 8.0.7600.16385
Cipher Strength: 256-bit
Product ID: 00371-177-0000061-85791
Update Versions: 0

I'm running a tournament tonight so no changes before that but I'll look into the options you gave when I get a chance.

Thanks!

CruiseLite

  • Newbie
  • *
  • Posts: 43
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #3 on: May 23, 2010, 12:50:20 PM »
More fuel for the fire!  :)

New configuration:
Got tired of trying to determine if it was a win7 issue so put a different HD in the laptop and installed:
openSUSE 11.2 (x86_64)
VirtualBox 3.1.8 r61349

Installed windows XP Pro SP2 in a virtual machine
Installed SP3
Installed all current XP updates
Upgraded IE to:
Version: 8.0.6001.18702
Cipher Strength: 256-bit
Product ID: 01398-640-2947616-234921
Update Versions: 0
(Interesting that the version seems to be older than I posted below but that was under Windows 7 Pro)

I have set IE options as follows:
- Disable script debugging (Internet Explorer)
- Disable script debugging (Other)
Uncheck  "Enable third-party browser extensions"

Ran a mock tournament and it seemed to be okay.

Ran 3 tournaments last night and the first went great. Did not see any noticeable slowdowns; Auto-save was enabled.
Shortly after starting the second tournament (within 1-2 min)  I again began to notice the clock halting.
The halts initially were 1-2, 3-4 seconds but at times much longer. Gradually the pauses were as long as 3-4 minutes.
The clock would catch up eventually so that the overall time seemed to be correct.
It got so bad toward the end of round 1 that I received several error dialogs (attached the 2 I saved)
I even rebooted the virtual XP machine to see if that would help but when I started the tournament back up it was no better.
I eventually just let it go because as I said the overall round times were basically correct but any knockout was dreaded because it would take forever to display the screen to do the knockout.

The 3rd tournament was basically the same as the 2nd.

This morning I'm re-running a copy of the 2nd tournament and here are some notes on it as I'm observing:
Round 1 - (auto-save not enabled) immediately shows the pauses (4-8 seconds)
Task manager shows mshta.exe at 90+% CPU, over all CPU at 100%
Round 2 - mshta at 80-90%, over all at 100%, clock pauses 2-3 seconds
I modified the run priority of mshta to BelowNormal about 5 min into the round.
This changed the mshta CPU usage to 40-70% with spikes to 90+%
Round 3 - mshta at a steady 40% with occasional spikes to 80%, over all 55-60%. Clock pauses were minimal
Round 4 - mshta at 70-90% with spikes to 100%, clock pauses  consistent 3-4 seconds
I enabled auto-save about 5 min into the round
Break 1 - mshta at 45-55% with spikes to 90%, over all about 75-80%

Basically it seems to be running fairly well. No major changes from last nights environment other than lowering the priority for mshta.

I realize the above probably does not help a whole lot but I'm just trying to document in detail so that anyone else may get some ideas as to what to try.
I have also occasionally seen the script debugging error while running tournaments but I just always answer "no" and go on.

I'm open to suggestions if anyone has them. I just wanna play!!!  :D

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5423
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #4 on: May 24, 2010, 10:40:17 AM »
The first problem (progressively slower operation) sounds like something that has been trouble for a select few users of the software as long as I have been developing the software.  Unfortunately we've never been able to figure out why this occurs.

The error messages are interesting, but I can't draw any definite conclusions from them.  To speculate, it sounds like Internet Explorer gets so hosed up it won't even let the code access the display any more.  It looks like the program is simply trying to read the values on the Game tab of the Settings window but IE is telling it "permission denied".  Hosed.  Up.

Your second description, CPU spikes and lagging display, sounds exactly like what I see on a few of my development machines and VMs (and incidentally, the exact version of IE, 8.0.6001.18702, on my Win XP box that has the trouble).  I don't see it using version 2.5.10 of the software - only version 2.6 (still in beta testing), so that seems odd to me that you see this issue.  And so far, I only see it with IE8.  So there is something for you to try: on your VM, don't install IE 8, go back to IE 7 and see if it helps.

I'm currently running through a lot of versions of IE on Vista Home, Ultimate, Win XP home, professional, and Windows 7 to see if I can get a better idea of which IE component (and which version of that component) might be causing the issue.  I don't see the problem on Vista Ultimate, for example, with IE6 or IE7, but as soon as I upgrade to IE8, the trouble starts.  I'm *really* hoping this goes away with the next major or minor release of IE.

AdamK

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #5 on: November 06, 2010, 10:33:58 AM »
I have a new Lenovo X200 with Windows 7 Ultimate 64-bit. My tournaments run fine for a couple of hours. Eventually I start to notice the slowdown when I go to bust out a player. The program lags and I have to wait 3 to 5 seconds for the check marks to appear next to names. Th program is still running, just slow. The clock starts skipping several seconds at a time from that point on. The sounds no longer play either.

Not sure what to try next?? I was thinking about running running it in a XP virtual PC, but it looks like people are having this issue with XP too.....

Magic_fubu

  • Hero Member
  • *****
  • Posts: 1035
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #6 on: November 06, 2010, 11:36:51 AM »
My question would be this to Corey: What was the original platform that TD was created on - XP or Vista? I don't think it should matter, but wondering if it's a potential backwards-compatability issue (like how one cannot play a PS2 game on a PS1 system)
My cowboys shot down your rockets
---
If you send a request to me please send that you got me from here w/your TD name to confirm. Thanks!

AdamK

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #7 on: November 06, 2010, 12:23:42 PM »
I've been running some test tournaments this morning to watch it a little closer. CPU usage starts low, then steadily climbs until it peaks at 50%. Memory usage slowly climbs the entire time. An hour and a half in and it's hit 243,000K. The clock is skipping 1 to 2 seconds pretty consistently. After hitting 'x' the screen takes about 5 seconds to appear. The lag to check players and hit the 'Done' button is about 4 to 5 seconds on each....

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5423
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #8 on: November 06, 2010, 03:02:10 PM »
Since discovering what the problem was with 2.6, it confirmed (mostly) my suspicions that this is an IE/VM memory management issue.  It has nothing to do with how much system memory you have, but how IE and its Javascript virtual machine manages memory within IE.  The applicable part here, I think, is that in my testing different versions of IE exhibited different symptoms.  For example, in 2.6 the issue turned out to be the way I had implemented classical inheritance, and the code to do this was generating over 18,000 dynamic functions when the software started up.  IE did not like this.  Ultimately I figured out a much better way to accomplish what I was doing, and the problem basically went away.  But before this, I had tested on different versions of Windows using different versions of IE and got inconsistent results at best.  While IE8 has a lot of speed improvements over IE7, IE8 did not seem to handle memory management as well.  The stuttering problem did not happen on IE7.

I run the software on Windows 7 Professional 64-bit and Windows 7 Home Premium 64-bit on a daily basis.  No problems.  In fact, it screams.  I love it.  I also run it on Windows XP Media Center Edition (32-bit) on a daily basis.  Again, no problems.  All run under IE8, but I also use virtual machines to run it under Vista, and to use IE 7.

Bottom line: I still don't know why this happens, but I suspect it is certain versions of IE, possibly combined with certain versions of Windows.  If you can upgrade IE, give that a try.  On Windows 7 you can't go back before IE8, so you're kind of stuck, unless you want to try IE9, which is still in beta.

Workaround: while it would certainly be best of the software didn't have memory/slowdown issues, you can work around this pretty easily: at a convenient time, like during a break, save the tournament.  Exit the TD.  Re-start the TD.  Load the tournament.  Now you are right back where you were, but memory has been "reset".  Hopefully the problem has gone away and you won't see it again during the rest of the tournament.

AdamK

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #9 on: November 06, 2010, 03:23:42 PM »
I run the software on Windows 7 Professional 64-bit and Windows 7 Home Premium 64-bit on a daily basis.  No problems.  In fact, it screams.  I love it.  I also run it on Windows XP Media Center Edition (32-bit) on a daily basis.  Again, no problems.  All run under IE8, but I also use virtual machines to run it under Vista, and to use IE 7.

So it's the BETA that's running well for you under Windows 7 64-bit and IE 8? I'm more than willing to do that if that cures the problem and if the software will get me through a tournament without much trouble. How close are you to releasing the new version?

Thanks!

Magic_fubu

  • Hero Member
  • *****
  • Posts: 1035
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #10 on: November 06, 2010, 04:28:50 PM »
Adam, Per a post earlier today in the Beta forums, he's very close to releasing the final beta. From there, it's going to be some testing to see what bugs/performance issues, and what not gets reported to him. If all goes well, who knows how soon it would be???
My cowboys shot down your rockets
---
If you send a request to me please send that you got me from here w/your TD name to confirm. Thanks!

AdamK

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #11 on: November 06, 2010, 04:37:23 PM »
Adam, Per a post earlier today in the Beta forums, he's very close to releasing the final beta. From there, it's going to be some testing to see what bugs/performance issues, and what not gets reported to him. If all goes well, who knows how soon it would be???

OK. Sounds like he's most of the way through the cycle then. I just wanted to, one, make sure the BETA actually runs better with Windows 7 64-bit and two, get a feel for where he was in development of this version. I can live with a few bugs until it's officially released.

AdamK

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #12 on: November 06, 2010, 08:17:26 PM »
I loaded the BETA and have the same problem, just not quite as bad. After a couple of hours I get 1 to 2 second lags, but not the 3 to 4 in the older version.

I hadn't realized I could just save, exit and reload to continue where I left off without missing a beat. That'll work for now.

Too bad this issue is such a tough one to track down. Seems the user base of this product is going to be moving into Windows 7 and IE 8 over time. A solution would be a good thing to find! :)

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5423
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #13 on: November 08, 2010, 10:13:20 AM »
I run the software on Windows 7 Professional 64-bit and Windows 7 Home Premium 64-bit on a daily basis.  No problems.  In fact, it screams.  I love it.  I also run it on Windows XP Media Center Edition (32-bit) on a daily basis.  Again, no problems.  All run under IE8, but I also use virtual machines to run it under Vista, and to use IE 7.

So it's the BETA that's running well for you under Windows 7 64-bit and IE 8? I'm more than willing to do that if that cures the problem and if the software will get me through a tournament without much trouble. How close are you to releasing the new version?

Thanks!

No, it's all versions that are running well under Windows 7 64-bit and IE 8.  In fact, 2.6 alpha 1, beta 1, and beta 2 did NOT run will under IE8.  They exhibited the memory management slowdown.  I fixed this in beta 3 and it runs well again.  But earlier versions have always worked fine.

AdamK

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: MSHTA,EXE at 100% CPU
« Reply #14 on: November 08, 2010, 11:06:35 AM »
I run the software on Windows 7 Professional 64-bit and Windows 7 Home Premium 64-bit on a daily basis.  No problems.  In fact, it screams.  I love it.  I also run it on Windows XP Media Center Edition (32-bit) on a daily basis.  Again, no problems.  All run under IE8, but I also use virtual machines to run it under Vista, and to use IE 7.

So it's the BETA that's running well for you under Windows 7 64-bit and IE 8? I'm more than willing to do that if that cures the problem and if the software will get me through a tournament without much trouble. How close are you to releasing the new version?

Thanks!

No, it's all versions that are running well under Windows 7 64-bit and IE 8.  In fact, 2.6 alpha 1, beta 1, and beta 2 did NOT run will under IE8.  They exhibited the memory management slowdown.  I fixed this in beta 3 and it runs well again.  But earlier versions have always worked fine.

I'm really confused now?? Your first sentence says, "it's all versions that are running well under Windows 7 and IE 8...". The second sentence says, "2.6 alpha 1, bet 1 and bet2 did NOT run under IE8"??

I loaded up 2.6.b3 and while it is better, it still slows down over time. I'd say it's about 50% better. The clock only loses a second every other second after an hour or two. 2.5.x lags by about 2 or 3 seconds after that amount of time.....