Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OutOfMemory error

 
Chad McGowan
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am continuously getting outofmemory errors when loading large amounts of data(ie, iterating through hourly temperatures for 20 years). Is there a way to tell how much memory is being used at a certain point in my program? This would help with debugging and also help me to set a limit on data read in at once. Thanks
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the JVM option <code>java -verbose:gc</code> - this will cause the system to print memory usage information every time it does garbage collection. You may also find it useful to increase the memory allocated to the JVM using the -Xmx option. See the documentation here for more details, assuming you're using JDK 1.3 for Windows. Otherwise find the appropriate documentation for your JVM - there's probably something similar.
[This message has been edited by Jim Yingst (edited June 08, 2001).]
 
Aj Manch
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chad McGowan:
I am continuously getting outofmemory errors when loading large amounts of data(ie, iterating through hourly temperatures for 20 years). Is there a way to tell how much memory is being used at a certain point in my program? This would help with debugging and also help me to set a limit on data read in at once. Thanks

Chad,
How do you define 'certain point'? If you want to find out the peak memory consumption you can probably toy around with performance monitor on the Windows Task Manager. Jim has a good solution but not sure if you can find out the peak memory consumption.
AJ
 
Chad McGowan
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jim's solution helped me solve my problem. Thanks Jim. Using verbose:gc, I could see approximately how much memory was being used with each data load.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic