• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Too many window.open calls cause problem?

 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have about 40 hyperlinks on my jsp page which calls to a struts action with the target="_blank" setting so that it will open the url in a new window.



This works fine, but I do see a problem if I click all 40 hyperlinks. The use method should be, click hyperlink, do work on pop up page, close pop-uped page. But, of course, this is not how the user in field is using it. They are clicking with abandon and eventually the pop ups stop rendering correctly (just a blank window opens) and the parent window freezes.

I am wondering if there is a limit to the number of new pop up windows you can create from one parent? Note, the <a href line with the target="_blank" is essentially the same as calling window.open(url) from javascript as far as I know.

Any help appreciated. I know everyone will say "don't use a pop up" and believe me I agree, I am trying to talk the powers that be into a new method, but until I can code that, i would like to get my app to stop freezing up like this.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the browser memory going through the roof?

Eric
 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Would I see the browser memory by looking at tomcat5.exe in the Process window of the task manager? That number does grow considerably per window.open call. Does that tell me that I have tomcat configured wrong, or that I am doing something wrong with my popup window?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tomcat and the browser have nothing to do with each other.

Perform the same test with a browser on a different system than the server. Which is locking up?
 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gah, sorry for my ignorance here. I just noticed that When I open the browser I see a new IEXPLORE.exe in the task manager. I open another browser and a new IEXPLORE.exe shows up. However, if I click on my pop up, which does open a new browser, I do NOT see a new IEXPLORE.exe show up.

The memory of the existing IEXPLORE.exe processes doesn't seem to grow as I bring up pop ups.

This is strange, wouldn't starting a new browser via the hyperlink start a new IEXPLORE.exe since the new browser has its own session? I guess not.
 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just did some testing, and locally I cannot recreate this problem (we were seeing it on a test machine at office but i am home now).

I have tomcat running at 88K of memory, and IE at 29K, then I open 40 pop up windows and see memory grow to 93K for tomcat and 54k for IE.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not saying that memory is the issue, but I think it could have been.

Eric
 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I am still fighting this problem and have found something interesting. I was assuming for a while that IE just got overwhelmed by having to manage so many child windows and that was causing the browser to freeze and to stop responding. However, after getting the browsers to freeze, I go to a completely differant client and the browser works fine until I try to bring up the same parent page, and it will not come up.
So, I open parent window, then child window a,b,c, ... eventually I get to child z and this child browser comes up blank and the parent window is frozen. Go to another client, and try to bring up parent window, it will not come up.
This makes me wonder is this a tomcat-IE relationship problem? Maybe I should move this question to the Tomcat forum?
Thanks,
Kim
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing Tomcat can do can cause a browser to lock up.

Have you tried the test I suggested? Does the browser lock up when it's not being run on the same machine as Tomcat?
 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I did try that, and yes the browser does lock up on a client machine that is not the same machine running tomcat.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you run fiddler or some other proxy tool are you seeing the request go out and come back?

http://www.fiddlertool.com/fiddler/

Eric
 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It appears that the request goes out and does not come back.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well sounds like it is an issue with your serverside than.

Eric
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eric Pascarello:
Well sounds like it is an issue with your serverside than.


I'm not sure I agree. And if it is, it's not a Tomcat issue, but an issue with the server-side code.

Originally posted by Kim Kantola:
It appears that the request goes out and does not come back.


You'll need to elaborate on this.

Have you enabled server-side logging to see if the response is being returned? And if not, where the hangup is?
 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All, thanks for hanging in there with me on this. It looks like a problem with some code that gets a list of data from the database. It is nothing fancy, but I guess the problem came up because the user was doing a training with a bunch of other users doing all the same actions at the same time pinging the same server from several clients.

I thought it was the multiple window.opens, but I think it was just a coincindence that it happened over time.

I thought synchronization was only needed for when you were setting data, I didn't think getting it would be a problem. Here is the code.
I have added a log message right before the below method is called, and then one message after it. In my log file I usually see the before and after messages over and over, but right before things lock up, I see two messages saying "going to get users" whith no "back from get users" in between. Then things are locked up. So, I guess this is a race condition? Would simply making the method synchronized make the second method call wait for the first to finish?
 
Kim Kantola
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Haven't resolved this issue yet but wanted to put a closing note in. It turns out that it wasn't the pop up code necessarily that caused my freeze up, but that the code allowed for some quick actions to be taken snd so the app got more "busy". It looks like too many requests going for a database connection at one time is where things lock up.

So, I am off to the threading forum!

Thanks everyone for your help.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic