• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Netbeans seemingly unresponsive to memory allocation requests

Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hi - I'm using NetBeans 5.5 and in my Java program am loading a few arrays into memory which total around 70MB. At a point a I get an OutOfMemoryError regarding the heap space. I have a Windows XP machine with 1GB RAM. It seems that the logical solution is to increase the initial and maximum heap memory; NetBeans documention seems to instruct one to do this using the flags -J-Xms128m -J-Xmx256m (to make the initial and maximum memory 128MB and 256 MB, respectively) either a) after netbeans.exe if launched from the terminal window or b) in a line of the netbeans.conf file if launched from a shortcut (netbeans_default_options="-J-Xms128m -J-Xmx256m).

Anyway I've tried this many times both ways and it seems that it has no effect. Using Runtime.getRuntime().freeMemory()
ManagementFactory.getMemoryMXBean methods in my program, I see that the total memory stays at 65,769,472, the initial heap memory is zero, and the max heap memory is 66,650,112 no matter how I start Netbeans. I can't seem to get the heap to be as large as I need. I don't believe I have any large background programs running, and the Windows Task Manager seems to show a lot of available memory (e.g. over 400MB Available Physical Memory - I don't know why it's not even more but this sounds ample).

Any suggestions? One thing I tried was to allow for no paging file under Control Panel/System/Advanced/Performance/Settings/Advanced, but this made no difference and I was surprised that after rebooting the "PF Usage" on the Task Manager Performance tab shows about 514MB. I don't know whether this is relevant to the problem; generally it seems I should be able to load 70MB of data into memory given my 1GB of RAM.

Thanks for reading this.

Jonathan Glass
If you're gonna buy things, buy this thing and I get a fat kickback:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic