Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:58

CPU at 100%


Poster: namba
Dated: Friday January 7 2005 - 14:11:44 GMT

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 ?


Poster: Andy
Dated: Friday January 7 2005 - 14:14:34 GMT

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

droste-effect


Poster: harm
Dated: Friday January 7 2005 - 14:20:37 GMT

I don't know what your previous post was, but maybe you have something in your code as this:
Code:
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.


Poster: Ruth
Dated: Friday January 7 2005 - 18:03:46 GMT

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

Ruth


Poster: namba
Dated: Wednesday January 12 2005 - 4:36:06 GMT

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:
Quote:

/*
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://www.milonic.com/ for more information.
See http://www.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 ?


Poster: Ruth
Dated: Wednesday January 12 2005 - 5:36:30 GMT

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


Poster: namba
Dated: Wednesday January 12 2005 - 8:30:12 GMT

thanks, the milonic_src.js file (as well as mmenudom.js and mmenuns4.js) vesion is:
Quote:
Version 5.63 - Built: Friday December 10 2004 - 18:50


here is my test html file:
Quote:
<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.


Poster: Ruth
Dated: Wednesday January 12 2005 - 17:25:56 GMT

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

Ruth


Poster: namba
Dated: Thursday January 13 2005 - 3:19:56 GMT

Thank you Ruth, I have upgraded to the latest version:
Quote:
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:
Quote:
/*
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://www.milonic.com/ for more information.
See http://www.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:
Quote:
<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


Poster: Ruth
Dated: Thursday January 13 2005 - 3:56:30 GMT

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:
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=http:\/
\/www.milonic.com\/mmenuns4.js><\/scr"+"ipt>");
  else _d.write("<scr"+"ipt language=JavaScript src=http:\/
\/www.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


Poster: namba
Dated: Thursday January 13 2005 - 4:38:01 GMT

Thanks Ruthm I tried your code but same problem.

I did another test along those lines I hardcoded each options of the if:

Quote:
<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

Quote:
<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 ?


Poster: Ruth
Dated: Thursday January 13 2005 - 5:44:12 GMT

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


Poster: John
Dated: Thursday January 13 2005 - 14:07:28 GMT

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:
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.


Poster: kevin3442
Dated: Thursday January 13 2005 - 16:54:49 GMT

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:
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:
with(milonic=new menuname("")){

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

That should do it!

Cheers,

Kevin


Poster: John
Dated: Thursday January 13 2005 - 17:24:29 GMT

Smart aleck :!:

So why doesn't it fail here with his code... :?:


Poster: kevin3442
Dated: Thursday January 13 2005 - 21:12:48 GMT

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


Poster: John
Dated: Thursday January 13 2005 - 21:16:11 GMT

Locally. I brought all his code down to my server and opened the monitor. No problems.


Poster: namba
Dated: Friday January 14 2005 - 5:33:38 GMT

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