• 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

How do you decide the value of -Xmx?g ?

 
Ranch Hand
Posts: 334
2
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been reading about how too big a value can cause problems. Is the only problem that garbage collection can take a long time. Virtual memory swapping is not an issue here.

The problems with too small a value are fairly obvious, program fails or too many garbage collections eating up too much time.

What I've been doing is profiling the applications to get an idea, a rough idea, of how much memory is needed. Multiply that by a fudge factor (3 or 4 lately) and using that.

Is there a better way?

Thanks,
Joe
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the specific problem you are trying to solve? Do you have specifications so you know when you've accomplished it?

In other words, if you can't quantify the problem and solution , you can tweak for years and never know when you are done...
 
Joe Areeda
Ranch Hand
Posts: 334
2
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Fred,

The problem is pretty general. I'm trying to learn a more scientific way to allocate memory for the JVM. Tweaking forever may very well be my fate.

My project is a JEE data visualization app that uses a proprietary network protocol to display/analyze a huge (2PB and growing) data store.

Getting the data is a pretty slow operation so there is a series of cron jobs running on various schedules that maintain a mysql database that among other things acts as an index to speed searching.

I've been tweaking these programs to divide the problem into manageable chunks, but as the data grows the memory needs grows.

My reading suggests it's not a good idea to just assign as much memory as you have.

I wish I could be more specific but I don't have an acute problem, yet.

Joe
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic