• Post Reply Bookmark Topic Watch Topic
  • New Topic

Memory usage decrease after minimizing java console  RSS feed

 
Cameron Dalton
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. I wrote an application which is currently invoked using Java Web Start. I'm not posting in that forum because I'm not sure this issue is related to JWS.

When looking at the Windows Task Manager, I can see that as my application starts up the memory usage quickly ramps up to around 130,000K. When I have the Java Console set to display, and I minimize the console, memory usage drops to around 4,000K. Restoring the console bumps memory usage up to around 12,000K.

If I run my application with Java set to NOT show the Java Console, memory usage is still around 130,000K after application startup.

I have a couple questions here. First, if minimizing the console cuts memory usage down to 4,000K, why doesn't my application have such low memory usage when the console is not displayed at all? Second, is there any way I can reduce the memory footprint without having to minimize the console? This application is supposed to run indefinitely and without human interaction on system startup, and shouldn't require a user to minimize the console. Does anyone have any ideas on these questions?

Thank you.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, interesting problem, what sort of application are you running? Do you load in lots of data, perform lots of logging?
 
Cameron Dalton
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your response, Martijn. The application is a single JMS consumer. I understand that requires extra threading in the background, but I'm not sure why that would involve lots of memory usage. No data is loaded (other than small JMS messages), and logging is very minimal. The one thing that is exceptional is the amount of JARs downloaded by JWS and added to the classpath. This application loads IBM's app client JAR collection, which contains 60 JAR files in a total of 68.5MB. I wouldn't think JWS-loaded JAR files would be maintained in memory until a class is actually loaded by the class loader, but I guess you never know. But even still, why would the memory usage drop so significantly after something so unrelated as minimizing the Java Console?
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cameron,

Thanks for the extra info. It certainly sounds like the memory usage with JWS spikes as it's downloading/loading in the JAR files. I suspect the GC then cleans that all up and your application goes back into normal processing. How the console/no console is affecting that I'm not really too sure, is this the std Java console we're talking about?

Oh, what version of the JWS/JRE/JDK are you using?
 
Cameron Dalton
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, just the standard console that you can turn on and off from the Java Control Panel. It does seem that it's related to the JARs but I don't get how the console is related. Version is 1.5.0, but it's from IBM so who knows...

Anyway, thanks for your help. I imagine I'll give up on this now and head down a different path to reduce memory footprint.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have to use the IBM 1.5 JDK/JRE? Can you experiment with Sun's 1.6.0_11 JDK/JRE (and teh corresponding latest version of Java Web Start), I'd be curious to see what happened.
 
Cameron Dalton
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't HAVE to use IBM's version (although IBM says I do), but the JAR downloads increase if I don't. When I tried that a couple days ago, it couldn't find some IBM classes that aren't bundled in the JARs I mentioned. I thought that when I have more time I'd do a jar search to find out which JAR contains these extra classes, add them to the JNLP, and then try it on Sun's 1.6. I once upon a time tried it on Sun's 1.5 and had the same memory footprint (although I'm not sure about the console thing since I didn't know about it back then to check).

When I do give that a shot I'll let you know what happened, since you're curious.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be interesting to see the differences (if any) you're probably aware that JDK/JRE 1.6.0_10+ radically changed things around this area.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!