|
|
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.
|
|

06-11-2008, 06:36 AM
|
|
Senior Member
|
|
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
|
|
|
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Can anyone give me an idea on how to increase the heap size in Netbeans. Im trying to extract a single file that has 24MB data.
My heap size is in default, how can i set it to a higher value in Netbeans6.1
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
|
|

06-11-2008, 06:39 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,065
|
|
|
Did you check on config file?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on September 4, 2008)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-11-2008, 08:11 AM
|
|
Senior Member
|
|
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
|
|
yes i did. here is my config file.
# ${HOME} will be replaced by JVM user.home system property
netbeans_default_userdir="${HOME}/.netbeans/6.1"
# Options used by NetBeans launcher by default, can be overridden by explicit
# command line switches:
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true"
# Note that a default -Xmx is selected for you automatically.
# You can find this value in var/log/messages.log file in your userdir.
# The automatically selected value can be overridden by specifying -J-Xmx here
# or on the command line.
# If you specify the heap size (-Xmx) explicitely, you may also want to enable
# Concurrent Mark & Sweep garbage collector. In such case add the following
# options to the netbeans_default_options:
# -J-XX:+UseConcMarkSweepGC -J-XX:+CMSClassUnloadingEnabled -J-XX:+CMSPermGenSweepingEnabled
# (see http://wiki.netbeans.org/wiki/view/FaqGCPauses)
# Default location of JDK, can be overridden by using --jdkhome <dir>:
netbeans_jdkhome="C:\Program Files\Java\jdk1.6.0_05"
# Additional module clusters, using ${path.separator} (';' on Windows or ':' on Unix):
#netbeans_extraclusters="/absolute/path/to/cluster1:/absolute/path/to/cluster2"
# If you have some problems with detect of proxy settings, you may want to enable
# detect the proxy settings provided by JDK5 or higher.
# In such case add -J-Djava.net.useSystemProxies=true to the netbeans_default_options.
The thing is i dont know the command to use in Netbeans 6.1. I use mr.Google of course it told me to use java -Xms(Min memory) -Xmx(max Memory) main
but that is use for a command line compilation.
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
|
|

06-11-2008, 08:19 AM
|
|
Senior Member
|
|
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
|
|
|
I even visited the site inside the config but it only tells to change the algorithm of the garbage collector not to increase the heap size. . .
Can I use other data type to store a 24MB file? what is the best data type to use for a large File? im trying Sting array but i have that outofmemory error ^_^
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
|
|

06-11-2008, 08:21 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,065
|
|
|
You have to increase -J-Xms32m and -J-XX:MaxPermSize=200m in same size. Save the file and restart NetBeans. It works fine for me.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on September 4, 2008)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-11-2008, 08:25 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,065
|
|
Originally Posted by Eku
I even visited the site inside the config but it only tells to change the algorithm of the garbage collector not to increase the heap size. . .
Can I use other data type to store a 24MB file? what is the best data type to use for a large File? im trying Sting array but i have that outofmemory error ^_^
Are you write data to a file? I'm not clear. If so why you worried about the size.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on September 4, 2008)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-11-2008, 08:32 AM
|
|
Senior Member
|
|
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
|
|
|
i try using
-J-Xms64m and -J-XX:MaxPermSize=300m
but still it aint enuf...
i also try
-J-Xms128m and -J-XX:MaxPermSize=400m
-My netbeans Wont Run Anymore maybe because my RAM is only 512mb. 400 + 128 = 528 T_T
now i tried using
-J-Xms64m and -J-XX:MaxPermSize=400m
I got the same result. I guess this machine really needs an upgrade. =) What type of data type can store more than a String can?
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
|
|

06-11-2008, 08:33 AM
|
|
Senior Member
|
|
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
|
|
|
Im trying to Open a File. collect the Data. Process the data and store them in their own specific database. =)
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
|
|

06-11-2008, 09:00 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,065
|
|
|
Yep, you need an upgrade. Your first attempt, you can't exceed the total memory on the system. Thats is 512.
Even on the second attempt, what happened is the memory is not enough on the system for other process.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on September 4, 2008)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-11-2008, 09:05 AM
|
 |
Senior Member
|
|
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 526
|
|
im trying Sting array but i have that outofmemory error ^_^
How about breaking those data into chunks...(Another String arrays)
I guess, the maximum String array length is the same as the MAXVALUE of an integer can handle or lesser...
PS. NetBeans is also a Program made from Java... it can handle more than 24MB of data in a project...
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Last edited by sukatoa : 06-11-2008 at 09:19 AM.
|
|

06-11-2008, 09:07 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,065
|
|
Originally Posted by Eku
Im trying to Open a File. collect the Data. Process the data and store them in their own specific database. =)
That means, you've an issue with buffering the file, because of large size. Can't you split the original file.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on September 4, 2008)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-11-2008, 09:45 AM
|
|
Senior Member
|
|
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
|
|
|
No i cant. that 24MB file is an output of a bigger system that has 81 columns and the data is in a straight single line. So i dont know where i can make a split. it consists of 176K data. ^_^ Actually this is not my problem, i just want to know what can i do if this kind of problem came to my Desk ^_^
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
|
|

06-11-2008, 09:56 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,065
|
|
|
Here is my comment,
1. This is a bad practice. Even this is not an issue on your end, records data to such a large files is a bad practice. You can survive up to some level because of Java.
2. Next solution is, increase the heap size. But you have limitations depend on your system.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on September 4, 2008)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|

06-12-2008, 09:07 AM
|
|
Senior Member
|
|
Join Date: May 2008
Location: Makati, Philippines
Posts: 191
|
|
|
Thanks a Lot Erangga. I'll look for a better way to deal with Large files. =)
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
|
|

06-12-2008, 09:36 AM
|
 |
Moderator
|
|
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,065
|
|
|
np my friend.
Did you use a BufferedReader to read that large file? If so, you system is freeze reading that large file? I never comes with such things. Even my server applications I never allowed to create a file more that 5MB of size. Basically log files.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Has someone helped you? Then you can To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. their helpful post.
Want to make your IDE the best? To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. (Close on September 4, 2008)
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|