CPU at 100%

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
namba
Beginner
Beginner
Posts: 8
Joined: Thu Jan 06, 2005 1:19 am

CPU at 100%

Post by namba »

I have investigated a bit further the problem I submitted earlier with the vertical menu, I have created a smaller menu arborescence of about 300 lines and still when I click on the menu the CPU reach 100% and the machine is stuck for 10 seconde then the window asking me if I want to abort the script pop up I click on Yes and can continue working.

We are currently evaluating the menu, if we are confident it will work in our environment we will get the corporate licence right away, could we send you our code so you can investigate further and tell us if there is something wrong ?
User avatar
Andy
Milonic
Milonic
Posts: 3308
Joined: Sun May 19, 2002 8:23 pm
Location: Menu Developer
Contact:

Post by Andy »

Hi,

If you can give us a URL where this happens or at the very least tell us the version of the menu you are using we'll do our best.

Sounds like it's an infinite loop but I've not heard of nay other problems so could be unrelated to the menu

Cheers
Andy
harm
Beginner
Beginner
Posts: 3
Joined: Fri Jan 07, 2005 1:15 pm

droste-effect

Post by harm »

I don't know what your previous post was, but maybe you have something in your code as this:

Code: Select all

with(milonic=new menuname("Alpha")){
style=menuStyle;
aI("text=Geschiedenis;showmenu=Alpha;");
aI("text=Test;url=test.html;");
}
And that's what may cause your CPU to 100%, because the submenu of Alpha, is Alpha, and the submenu there of is again, Alpha; to the infinity.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Thanks for your input, Harm. It's great to see others answering in the forum. Jump in any time! :D

Ruth
namba
Beginner
Beginner
Posts: 8
Joined: Thu Jan 06, 2005 1:19 am

Post by namba »

Thank you,
sorry I cannot provide an URL, the website I am working on is on our Intranet.

I tried with a much shorter menu and but still the CPU hits 100% for about 10 sec whatever I use IE or firefox, the menu_data.js is the only modified file:

/*
Milonic DHTML Menu - JavaScript Website Navigation System.
Copyright 2004 (c) Milonic Solutions Limited. All Rights Reserved.
Version 5+ Data File structure is the property of Milonic Solutions Ltd and must only be used in Milonic DHTML Products
This is a commercial software product, please visit http://milonic.com/ for more information.
See http://milonic.com/license.php for Commercial License Agreement
All Copyright statements must always remain in place in all files at all times
******* PLEASE NOTE: THIS IS NOT FREE SOFTWARE, IT MUST BE LICENSED FOR ALL USE *******
*/

_menuCloseDelay=500 // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150 // The time delay before menus open on mouse over
_subOffsetTop=10 // Sub menu top offset
_subOffsetLeft=-10 // Sub menu left offset



with(menuStyle=new mm_style()){
onbgcolor="#990003";
oncolor="white";
offbgcolor="#ffc6a5";
offcolor="black";
bordercolor="black";
borderstyle="solid";
borderwidth=1;
separatorcolor="black";
separatorsize="1";
padding=5;
fontsize="70%";
fontstyle="normal";
fontfamily="Arial, Helvetica, Verdana";
pagecolor="black";
pagebgcolor="#82B6D7";
headercolor="#ffffff";
headerbgcolor="#000099";
subimage="/menus/arrow.gif";
subimagepadding="2";
overfilter="Alpha(style=0,opacity=100);Shadow(color='#666666', Direction=135, Strength=2)";
}



with(milonic=new menuname("")){
style=menuStyle
alwaysvisible=1;
top=180;
left=10;
overflow="scroll";
followscroll=1;
itemwidth=158
aI("text=example.html;url=/example.html;");
aI("text=johan.html;url=/johan.html;");
aI("text=ploc.html;url=/ploc.html;");
aI("text=test.html;url=/test.html;");
aI("text=Overview;showmenu=Overview;url=/Overview;");
aI("text=Teams;showmenu=Teams;url=/Teams;");
}

with(milonic=new menuname("Overview")){
style=menuStyle
aI("text=Contact_Info;url=/Overview/Contact_Info;");
aI("text=Organization_Charts;url=/Overview/Organization_Charts;");
}

with(milonic=new menuname("Teams")){
style=menuStyle
aI("text=Contact_Info;url=/Teams/Contact_Info;");
aI("text=Organization_Charts;url=/Teams/Organization_Charts;");
}


drawMenus();
Is there something wrong with it ?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

We still need to know what version. In the milonic_src.js file it will give a version near the top 5.69 or something. I just put the data in a file and called the menu on a blank page and there's no problem. I get no cpu 100% or anything like that.
namba wrote:...window asking me if I want to abort the script pop up I click on Yes and can continue working.

I don't see anything about pop up in the menu data file you posted. Since you can't post a page, we would need the html page code and any css code you are using so we can duplicate the page and see what's going on.

Ruth
namba
Beginner
Beginner
Posts: 8
Joined: Thu Jan 06, 2005 1:19 am

Post by namba »

thanks, the milonic_src.js file (as well as mmenudom.js and mmenuns4.js) vesion is:
Version 5.63 - Built: Friday December 10 2004 - 18:50
here is my test html file:
<html>
<head>
<title>test</title>
</head>
<body>
<!-- Millonic menu -->
<script type="text/javascript" language="JavaScript" src="/_javascript/milonic_src.js"></script>
<script type="text/javascript" language="JavaScript" >
<!--
if(ns4)_d.write("<script type=\"text\/javascript\" language=\"JavaScript\" src=\/_javascript\/mmenuns4.js><\/script>");
else _d.write("<script type=\"text\/javascript\" language=\"JavaScript\" src=\/_javascript\/mmenudom.js><\/script>");
-->
</script>
<!-- vertical menu -->
<script type="text/javascript" language="JavaScript" src="/_javascript/menu_data_test.js"></script>
<!-- End Millonic menu -->
</body>
</html>
please tell me your email in PM and I will send you a zip of the files I use.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

You need to upgrade to 5.69. Try that and see if the problem disappears.

Ruth
namba
Beginner
Beginner
Posts: 8
Joined: Thu Jan 06, 2005 1:19 am

Post by namba »

Thank you Ruth, I have upgraded to the latest version:
Version 5.691 - Built: Wednesday January 12 2005 - 11:49
For my test I just modified the menu_data.js (which I named menu_data_test.js), as below:
/*
Milonic DHTML Menu - JavaScript Website Navigation System.
Copyright 2004 (c) Milonic Solutions Limited. All Rights Reserved.
Version 5+ Data File structure is the property of Milonic Solutions Ltd and must only be used in Milonic DHTML Products
This is a commercial software product, please visit http://milonic.com/ for more information.
See http://milonic.com/license.php for Commercial License Agreement
All Copyright statements must always remain in place in all files at all times
******* PLEASE NOTE: THIS IS NOT FREE SOFTWARE, IT MUST BE LICENSED FOR ALL USE *******
*/

_menuCloseDelay=500 // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150 // The time delay before menus open on mouse over
_subOffsetTop=10 // Sub menu top offset
_subOffsetLeft=-10 // Sub menu left offset



with(menuStyle=new mm_style()){
onbgcolor="#4F8EB6";
oncolor="#ffffff";
offbgcolor="#DCE9F0";
offcolor="#515151";
bordercolor="#296488";
borderstyle="solid";
borderwidth=1;
separatorcolor="#2D729D";
separatorsize="1";
padding=5;
fontsize="75%";
fontstyle="normal";
fontfamily="Verdana, Tahoma, Arial";
pagecolor="black";
pagebgcolor="#82B6D7";
headercolor="#000000";
headerbgcolor="#ffffff";
overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color='#777777', Direction=135, Strength=5)";
outfilter="randomdissolve(duration=0.3)";
}


with(milonic=new menuname("")){
style=menuStyle;
top=240;
left=10;
alwaysvisible=1;
orientation="vertical";
aI("text=johan.html;url=/_johan/johan.html");
aI("text=Overview;showmenu=Overview;url=/_johan/Overview/index.html");
aI("text=Teams;showmenu=Teams;url=/_johan/Teams/index.html");
}


with(milonic=new menuname("Overview")){
style=menuStyle;
overflow="scroll";
aI("text=submenu1;url=none;");
aI("text=submenu2;url=none;");
}

with(milonic=new menuname("Teams")){
style=menuStyle;
overflow="scroll";
aI("text=submenu1;url=none;");
aI("text=submenu2;url=none;");
}

drawMenus();
I have created a directory tree as follow:
_Johan (index.html. johan.html)
├─Overview (index.html)
└─Teams (index.html)

all the .html have the following code:
<html>
<head>
<title>test</title>
</head>
<body>
<!-- Millonic menu -->
<script type="text/javascript" language="JavaScript" src="/_javascript/milonic_src.js"></script>
<script type="text/javascript" language="JavaScript" >
<!--
if(ns4)_d.write("<script type=\"text\/javascript\" language=\"JavaScript\" src=\/_javascript\/mmenuns4.js><\/script>");
else _d.write("<script type=\"text\/javascript\" language=\"JavaScript\" src=\/_javascript\/mmenudom.js><\/script>");
-->
</script>
<!-- vertical menu -->
<script type="text/javascript" language="JavaScript" src="/_javascript/menu_data_test.js"></script>
<!-- End Millonic menu -->
</body>
</html>
The first time I point my browser (either Firefox v1.0 or IE 6.0.2800.1106)
to my test url http://devserver/_johan/ the page got load immediatly and the menu is displayed, the problem occur when I click on a link, for example I click on "Teams" and the PC froze (the CPU reach 100%) for a couple of seconds, then I got the popup asking me if I want to abort the script, if I abort it I can continue
Image
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I don't know if this would matter, but the call for the menus is different than you have.
Let's assume the files are at milonic, the call for the mmenudom.js and menuns4.js would be

Code: Select all

 <script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=http:\/
\/milonic.com\/mmenuns4.js><\/scr"+"ipt>");
  else _d.write("<scr"+"ipt language=JavaScript src=http:\/
\/milonic.com\/mmenudom.js><\/scr"+"ipt>");
</script> 
Note that there is a scr+ipt in the call. I don't know if changing that to what you have would cause problems or not.

Ruth
namba
Beginner
Beginner
Posts: 8
Joined: Thu Jan 06, 2005 1:19 am

Post by namba »

Thanks Ruthm I tried your code but same problem.

I did another test along those lines I hardcoded each options of the if:
<script type="text/javascript" language="JavaScript" src="/_javascript/milonic_src.js"></script>
<script type="text/javascript" language="JavaScript" src="/_javascript/mmenuns4.js"></script>
<script type="text/javascript" language="JavaScript" src="/_javascript/menu_data_test.js"></script>
-> quick but the menu is unusable
<script type="text/javascript" language="JavaScript" src="/_javascript/milonic_src.js"></script>
<script type="text/javascript" language="JavaScript" src="/_javascript/mmenudom.js"></script>
<script type="text/javascript" language="JavaScript" src="/_javascript/menu_data_test.js"></script>
-> the CPU got to 100%

could something be wrong in the mmenudom.js file ?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I've used your code and the page you posted and opened it in Netscape6.1 and 7.1, Firebird .07, IE5.5 and I do not get the message you are getting. I don't know what else to suggest. You might repost this topic..perhaps Still getting cpu100% error or something like that and maybe someone else will be able to help. Sorry, I can't do more.

Ruth
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

I brought you code down to my server and am having no troubles at all (running 5.69 right now). No spikes, no delays, no errors. See http://www.west.asu.edu/sa/testsite/.

My menu call is a bit different than both yours and Ruth's...

Code: Select all

if(ns4)_d.write("<scr"+"ipt language=javascript src=/sa/menu5/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=javascript src=/sa/menu5/mmenudom.js><\/scr"+"ipt>");
...but I have no idea if that's a problem.
John
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi namba,

Please sit down, because once you learn what the problem is, you might smack yourself in the forehead ;)

The problem is that your main menu does not have a name. Note that in your last menu_data_test.js code, your main menu is:

Code: Select all

with(milonic=new menuname("")){ 
style=menuStyle; 
top=240; 
left=10; 
alwaysvisible=1; 
orientation="vertical"; 
aI("text=johan.html;url=/_johan/johan.html"); 
aI("text=Overview;showmenu=Overview;url=/_johan/Overview/index.html"); 
aI("text=Teams;showmenu=Teams;url=/_johan/Teams/index.html"); 
}

It looks good for the most part, but in the first line of code, the menu name is a null string: menuname(""). This was true in the previous test code as well. I'm guessing that it was probably just a simple oversight; one of those little, easy-to-miss things that screws everything up and drives you nuts trying to find later (my personal demon is using a = operator when I should've used ==).

So, instead of

Code: Select all

with(milonic=new menuname("")){
put a name in there. Any name will do. For example:

Code: Select all

with(milonic=new menuname("MainMenu")){
That should do it!

Cheers,

Kevin
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Smart aleck :!:

So why doesn't it fail here with his code... :?:
John
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

kevin3442 wrote:...once you learn what the problem is, you might smack yourself in the forehead ;)
John wrote:Smart aleck :!:
:oops: well... yeah. I just know how I react when one of those happens to me... I have the palm prints on my noggin to prove it!
John wrote:So why doesn't it fail here with his code... :?:
Did you test locally, or through http? When I tried namba's test scheme (his directory structure and all) directly from a local hard disk, then everything worked fine; no CPU spike, no warning. But when I uploaded the same exact code to our staging server, and tried it as served pages, then I got the CPU spike and the warning dialog, just as namba described. Why? Beats me! It seems sort of odd to me. Since the menus are rendered on the client side, why would it make a difference? I'm at a loss to explain it. If anyone knows, please enlighten me!

Cheers,

Kevin
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Locally. I brought all his code down to my server and opened the monitor. No problems.
John
namba
Beginner
Beginner
Posts: 8
Joined: Thu Jan 06, 2005 1:19 am

Post by namba »

You are a Genius Kevin, that was it, thank you !
Post Reply