How to Change the VM Heap Space on a Netbeans Platform Project

Asked

Viewed 400 times

6

I’m having the following problem:

I have a project from Application of the Netbeans Platform that during the execution the application hangs for good and nothing else responds (one minute of execution is enough to lock, this possibly occurs due to large queries that the application needs to do). And this problem occurs in a ratio of 2 times every 10 runs.

When the problem occurs the Netbeans exit does not capture any errors, however in the installed version of the project I managed to capture the following error: Outofmemoryerror: Java heap space

Well, I saw on that topic the suggestion to change VM options. However as the project is a Application of the Netbeans Platform, did not find in properties the VM options.

In another topic of the English version of the site, I saw the suggestion to add the property run.args.extra=-J-Xmx1024m stretch in the archive project properties., but apparently this property seems to be ignored and the problem continues to occur.

Does anyone know how I can change the VM settings on a Application of the Netbeans Platform?

1 answer

2


My suggestion is to modify directly in the netbeans configuration file:

netbeans conf.

You ponde meet him at:

global facility: ${Nb-install}/etc/netbeans.conf

or

local user: ${userdir}/etc/netbeans.conf

Search for the item: netbeans_default_options

# Options used by NetBeans launcher by default:
# (can be overridden by explicit command line switches)
#
# Note that default -Xmx and -XX:MaxPermSize are selected for you automatically.
# You can find these values in var/log/messages.log file in your userdir.
# The automatically selected value can be overridden by specifying -J-Xmx or
# -J-XX:MaxPermSize= here or on the command line.
#
# If you specify the heap size explicitly, you may also want to enable
# Concurrent Mark & Sweep garbage collector.
# (see http://wiki.netbeans.org/FaqGCPauses)
#

 
netbeans_default_options="-J-Xms1536m -J-Xmx2048m  ... outras opções ..."

In the example I added:

  • initial heap = Xms
  • heap maximo= Xmx
  • Dude, thanks for the answer, but unfortunately it didn’t solve my problem. I changed the netbeans settings on netbeans conf. from the intallation folder, but when executing the jar always generates with -J-Xms32m -J-Xm64m. But his reply was very helpful, because I could refine my search for the answer. I understand from the [Netbeans FAQ] (http://wiki.netbeans.org/FaqStartupParameters) this applies until version 7.x. I use Netbeans IDE 8.0.2. I’ll search for such a version

  • 1

    @Dener you tried to check messages.log to see if any useful information is returned. I’ll run some tests here and get back to you with a second opinion.

  • I saw here the message.log, and infezlimente there is not showing anything out of the normal

Browser other questions tagged

You are not signed in. Login or sign up in order to post.