I am continuously getting this java.lang.OutOfMemoryError - java

When I deploy and run my project in netbeans, I am getting this error.. And even after setting up JAVA_OPTS and CATALINA_OPTS in environmental variables as well as in netbeans 'VM options' as -Xms512m -Xmx2048m, I am getting same error.. Please, help me out to sort it out..
Exception in thread "http-bio-8080-exec-2" java.lang.OutOfMemoryError: PermGen space

if you start Tomcat from netbeans the -XX:MaxPerm... must go to server setting not JVM settings (or JAVA_OPTS).
go to sevices tab on the left
expand servers and right click on your tomcat
on the Platform tab, provide the necessary settings under VM options (for example -XX:MaxPermSize=256m -Xmx2048m )

Related

"Initial heap size set to a larger value than the max heap size" Error With Intellij 2019.2.1

I am facing a problem with Intellij 2019.2.1 version to which I recently upgraded. I have set up the Xms and Xmx in the Intellij Help -> Edit Custom vm options and I have also manually set up the same properties in idea64.exe.vmoption and idea.exe.vmoption as well. like below :-
-Xms128m
-Xmx10g
Now, when I am starting my application, in the VM argument of the application I am passing -Xmx800m then on runing the application it throwing an error stating that "Initial heap size set to a larger value than the max heap size".
Could some one please suggest what wrong configuration I am putting here or am I missing something.
IntelliJ IDEA VM options (Help | Edit Custom VM Options) have no effect on the VM options of the apps you start from IntelliJ IDEA. These are only for the IDE runtime JVM, not for your own apps that you develop.
Post a screenshot of the run/debug configuration showing the VM options field. What type of the configuration is that? It's possible that you have defined global system environment variables that set the initial heap size to some large value (-Xms). Make sure you don't have _JAVA_OPTIONS and JAVA_TOOL_OPTIONS environment variables set. If you do, remove them and logout/login or reboot for the changes to apply.
If the project is imported from Maven and you are running tests, pom.xml may supply the VM options, search pom.xml for for -Xms and either remove this option or make it lower than -Xmx.
If the project is Gradle based and you run it via Gradle, the options you have defined in gradle.properties via org.gradle.jvmargs will have effect. Make sure you don't override -Xms there. You can also switch to IntelliJ IDEA run option to not use Gradle options.

Java heap space error during deployment - returns “OutOfMemoryError"

I have spring app, with intelliJ (community edition), ant, tomcat 8.5. There is build.xml (ant) file that works for others, but in my case it gives me an error :java.lang.OutOfMemoryError: Java heap space.
I have already tried:
Creating setenv.bat (I'm on windows) set JAVA_OPTS=-server -Xmx1024m.
Then, setting CATALINA_OPTS/JAVA_OPTS/ANT_OPTS system env. variable to -Xms512m -Xmx1024m
Then in Configure tomcat(GUI) -> Java -> Initial memory pool and Maximum memory pool to 512 and 1024.
Then in idea.exe.vmoptions (intelliJ), changed -Xms to 512m and -Xmx to 1024m
But it keeps giving me an error about not enough heap space, while other app (spring mvc as well) works perfectly fine on the same computer with the same intelliJ and the same tomcat configuration (but with maven).
I will download JVisualVM to get better overview what is happening but in the meantime maybe someone could give me a tip what else I could try to fix it?

Liferay IDE maxpermsize setting not picked up

I have an issue with the Liferay IDE(on Mac OS) not picking up the -XX:MaxPermSize=512m setting in the setenv.sh in the tomcat bundle folder liferay-portal-6.2-ee-sp2/tomcat-7.0.42/bin.
CATALINA_OPTS="$CATALINA_OPTS -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false -Duser.timezone=GMT -Xmx1024m -XX:MaxPermSize=512m "
The maxpermsize setting is picked up[ when running the Liferay bundle from command line (./startup.sh).
However, maxpermsize setting is not picked up when running the server from the Liferay IDE.
I confirmed the above behavior by running visualVM.
There does not seem to be anyway to modify the JVM settings from the Liferay IDE on server properties or I can not find it easily.
Does anyone know how to override maxpermsize from the Liferay IDE?
Any insight is much appreciated!
Double click on Liferay server environment.
It will open up window where Memory args can be set as in image below.
The process to set Memory arguments should be same in Mac and other systems in liferay IDE/liferay developer studio.

Error when trying to increase java heap size

For a minecraft server I'm trying to run the server with more than the standard 512MB RAM. This used to work for me but when I recently installed the server again it stopped working. I use the following command line to run the server:
java -Xms1024M -Xmx2048M -jar TekkitLite.jar
pause
But when I run this script I get the following error:
C:\Users\...\server>java -Xms1024M -Xmx2048M -jar TekkitLite.jar
Picked up_JAVA_OPTIONS: -Xmx512M
Error occured during initialization of VM
Incompatible minimum and maximum heap sizes specified
It seems to me it just doesn't pick up the Xmx argument or something, and I haven't found a solution to fix it anywhere.
My system:
OS: Windows 7 64bit
Java: java7u45(64bit)
RAM: 8G
If anyone has a solution, that would be awesome :)
It looks like you have -Xmx512M set in the environment variable _JAVA_OPTIONS. Clear that and try again.
In Windows 7, this is done like this:
Right-click Computer from the Start menu and choose Properties
Click Advanced system settings > Advanced tab
Click on Environment Variables, find _JAVA_OPTIONS, and select it.
Click Delete
Click OK, and you're done!

JDeveloper Heap Out of Memory

I am getting the following error when I open a particular project in JDeveloper
Uncaught exception
java.lang.OutOfMemoryError: Java heap space
j.util.Arrays.copyOf(Arrays.java:2882)
j.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
j.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
j.lang.StringBuffer.append(StringBuffer.java:224)
org.tmatesoft.svn.core.SVNErrorMessage.getFullMessage(SVNErrorMessage.java:257)
org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:58)
org.tmatesoft.svn.core.internal.wc.admin.SVNAdminAreaFactory.open(SVNAdminAreaFactory.java:163)
org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess.doOpen(SVNWCAccess.java:364)
org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess.open(SVNWCAccess.java:272)
org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess.open(SVNWCAccess.java:265)
org.tmatesoft.svn.core.internal.wc.admin.SVNWCAccess.openAnchor(SVNWCAccess.java:145)
org.tmatesoft.svn.core.wc.SVNStatusClient.doStatus(SVNStatusClient.java:320)
org.tmatesoft.svn.core.javahl.SVNClientImpl.status(SVNClientImpl.java:296)
org.tmatesoft.svn.core.javahl.SVNClientImpl.status(SVNClientImpl.java:278)
org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.getStatus(AbstractJhlClientAdapter.java:480)
org.tigris.subversion.svnclientadapter.svnkit.SvnKitClientAdapter.getStatus(SvnKitClientAdapter.java:141)
org.tigris.subversion.svnclientadapter.javahl.AbstractJhlClientAdapter.getStatus(AbstractJhlClientAdapter.java:466)
o.ji.vcs.svn.SVNURLInfoCacheSimpleStrategy.getURLInfo(SVNURLInfoCacheSimpleStrategy.java:79)
o.ji.vcs.svn.SVNURLInfoCache.getLastChangedRevision(SVNURLInfoCache.java:69)
o.ji.vcs.svn.SVNOverlayProducer.createTooltip(SVNOverlayProducer.java:240)
o.ji.vcs.svn.SVNOverlayProducer.getDecoratedOverlay(SVNOverlayProducer.java:144)
o.ji.vcs.svn.SVNOverlayProducer.produceOverlay(SVNOverlayProducer.java:113)
o.j.vcs.spi.VCSOverlayItemProducer.produceOverlays(VCSOverlayItemProducer.java:83)
o.j.vcs.spi.VCSOverlayItemProducer.getOverlayItems(VCSOverlayItemProducer.java:65)
o.j.vcs.spi.VCSNodeOverlayTracker.getOverlays(VCSNodeOverlayTracker.java:288)
o.i.explorer.IconOverlayTracker.processPendingNodes(IconOverlayTracker.java:574)
o.i.explorer.IconOverlayTracker.access$1400(IconOverlayTracker.java:69)
o.i.explorer.IconOverlayTracker$7.run(IconOverlayTracker.java:487)
j.util.TimerThread.mainLoop(Timer.java:512)
j.util.TimerThread.run(Timer.java:462)
I have updated the jdev.conf file to include the following, but still receive the error:
AddVMOption -XX:MaxPermSize=512M
AddVMOption -Xmx512M
AddVMOption -Xms512M
Furthermore, this project opens just fine without issue on a colleague's computer, where the jdev.conf file -XX:MaxPermSize=512M switch is set to 256M and the other 2 switches are not present.
I've spent the afternoon playing with different settings, trying to discover the difference, and I am left stumped. Is there something I'm missing? When I try to bump the setting to higher memory limits, JDeveloper fails to start the Java machine (I suspect that is related to memory allocated to Java itself), though it shouldn't be necessary, as the app works fine on my coworker's computer with half the memory allocated to JDeveloper.
I faced the same issue and it get resolved with the help of below link :
Fixing java.lang.OutOfMemory Java Heap Space error in JDeveloper
Beside changing the configration fieles (jdev.conf and ide.conf) to have the commands
JDEV.CONF
AddVMOption -XX:MaxPermSize=256M
IDE.CONF
AddVMOption -Xmx768M
AddVMOption -Xms256M
See also this link:
Jdeveloper throwing Out of Heap Space error with SVN
Beside, stop versioning option for Jdeverlper as follow:
In JDeveloper -> Choose Versioning menu -> Choose Configure -> Uncheck “Versioning support for Subversion”
You can use some standalone SVN clients such as TortoiseSVN for
versioning
Egh. Simple, REALLY obvious solution that we just somehow overlooked. He is running an older version of JDeveloper. Installed that version, everything works.

Categories