• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Ranch Hand
Posts: 334
2
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • 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
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!