Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-20-2007, 09:51 PM
Member
 
Join Date: May 2007
Posts: 60
Jamie is on a distinguished road
OutOfMemoryError while creating a new object of file with size more than 150 MB
I have created an application which generates a report by getting the data from our archived files (.zip file).By the time, the application is reaching a file with size more than 150 mb, it is running out of memory while creating the object of that particular file. Can some one help me by telling if there is a way to resolve this issue?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-20-2007, 09:52 PM
Senior Member
 
Join Date: Dec 2006
Posts: 748
levent is on a distinguished road
If you're getting OutOfMemoryError, the simplest thing to try is to give the VM more memory at startup. For Sun's VM, I believe the default was 64 MB. You can increase this by using the -X args that control the heap size. For example:

java -Xms128m -Xmx256m ... etc. ...


This says start with 128 MB of heap, and allow it to grow up to 256 MB.

One thing to consider, though, is do you need that much stuff in memory at once? A more intelligent approach might be to unpack the archive to the file system, and then read a file at a time or a line at a time or a whatever at a time is appropriate for the processing you need to do.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Comparable object Java Tip java.lang 0 04-15-2008 08:38 PM
Creating a File object in Servlet Java Tip Java Tips 0 01-16-2008 11:24 AM
Object size kavithas New To Java 0 11-30-2007 01:00 PM
size of a java object ravian New To Java 0 11-12-2007 10:19 AM
Creating object of Type Object class venkatv New To Java 3 07-17-2007 04:33 PM


All times are GMT +3. The time now is 03:43 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org