• 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

help with allocating more memory during runtime

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys and girls. I recently had a post asking about a way to export data from a java program to an excel spreadsheet, which i successfully learned how to do. Now though i am running into a problem with a java out of memory exception when i go to finally write the excel file to the hard drive.

In the API for JXL which can be found here

keep in mind that you would need to download it to view it.

Anyways in this tutorial

the first question in the FAQ section talks about this problem with running out of memory when trying to generate large spreadsheets, which is the problem im having. I am trying to generate a spreadsheet with dimensions:
(row)(column): (10000)x(70)
the 10000 rows are double values.

I guess what i dont know about is how much memory to allocate to this process?
NOTE that i ran the process and it took two full days just to complete the 10000 iterations to get my data, and i got the exception when it tryed to write the excel file.

the FAQ gives an example, but i dont want to give it too much memory infear of it crashing my system midway through the tests or anything.So does anyone have any idea of how i could come up with th right amount of memory to allocate for this process.

I'll paste the faq since it isnt long:


i hope this is enough information, any tips or help from the experts would be awesome! thanks
 
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
You won't crash your system by giving Java too much memory unless you've got bad memory chips. If you've got a memory-intensive application, then make the heap as big as you can get away with -- start with 3/4 of physical RAM and see how that works out.
 
luc comeau
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so make the upper bound 3/4 of my RAM? Im going to assume yes, what about the lower bound?

I wish the damm thing didn't take so long to complete its iteration before it tells me it runs out of memory!I'm so strap for time i really can't afford to goof around with guessing how much memory to give the heap, but i guess its my only option. Hopefully it works, thanks for your reply Ernest
-Luc
 
reply
    Bookmark Topic Watch Topic
  • New Topic