• 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

JVM memory question

 
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Say I'm running the JVM on a windows machine - if a program uses a lot of memory, and the JVM throws the out of memory exception, does that mean that it ran out of both physical memory and virtual memory? I'm just wondering if the JVM makes that dinstinction at all, because if that's the case, then that's a huge amount of memory...
 
Phil Chuang
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I figured out that it can't tell the difference -
But now the question is,
is there a way to tell the JVM to take up as much memory as it needs? Ie, it's maximum memory allocation is whatever free memory windows has left?
I've tried specifying an arbitrarily huge number, but that doesn't work.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sun's JVMs don't have a "grow without bounds" switch. They do have a "grow up to such and such a limit" switch, as you've apparently already figured out. The largest possible value for this on Windows is either about 1.8 GB or 2.8GB, depending on Windows version/patch level. It's possible to use the largest legal value regardless of the size of the memory on the machine.
 
Phil Chuang
Ranch Hand
Posts: 251
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my testing, I've been able to specify -Xmx1588M on this windows 2k box.
1588Mb works out to be 1.55Gb.
Since my total memory is 1280Mb I'm going to guess that 1588 is a W2K limit.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic