• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Netbeans seemingly unresponsive to memory allocation requests

 
Greenhorn
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()
and
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
 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic