Increasing the memory size of an Intellij Plugin - intellij-idea

I'm developing an Intellij-Plugin. The Plugin needs to have 2GB of HeapMemory (... yes it really needs to ;) ). I found out how I can increase the Memory of the Intellij IDEA VM bis editing the idea64.exe.vmoptions-file like this:
-Xms128m
-Xmx2048m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=240m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
If i enable the memory indicator, i can see that it worked.
But if i run/debug my plugin out of Intellij, the "sandbox"-Intellij has only 1GB of RAM.
It throws the flowing warning:
High memory usage (free 101 of 914 MB) while dumping threads
How can i increase the RAM of the sandbox-Plugin?

Setting VM Options in run configuration doesn't work for me.
I found more proper way to do it from this. Add the following to your build.gradle:
runIde {
jvmArgs '-Xmx2G'
}

Related

Intellij idea Heap size can not be changed

Someday, I run something huge, and a window pop up said that heap memory out of memory, I set it to 2014M in that window, then click continue. Everything was fine.
But I don't like the number 2014, I want it 2048. So, I changed -Xmx option in idea64.exe.vmoptions (like below) and restarted idea. (According to this doc) However, nothing was changed, heap size was still 2014M.
-Xms512m
-Xmx2048m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
Then, I changed all idea64.exe.vmoptions I could find, and restarted, and still failed.
OS: windows 10 64-bit
idea version: 2018.1
How can I change the heap size to 2048M ?
Please help, thanks.
update:
That day, I was debugging with some codes which encrypt some huge objects, and the popup showed just after I use copy value function.
I tried to change the heap size of IntelliJ Idea's JVM as the official document, but not working.
The heap memory statistic is here:
update 2:
The log:
2018-07-23 09:54:04,184 [ 224] INFO - #com.intellij.idea.Main - JVM Args: -Xms512m -Xmx2048m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Djb.vmOptionsFile=C:\Users\huayu\.IntelliJIdea2018.1\config\idea64.exe.vmoptions -Didea.jre.check=true -Dide.native.launcher=true -Didea.paths.selector=IntelliJIdea2018.1 -XX:ErrorFile=C:\Users\huayu\java_error_in_idea_%p.log -XX:HeapDumpPath=C:\Users\huayu\java_error_in_idea.hprof
Newer versions of IDEA use a different file for vm options. Older versions used to use C:\Program Files\JetBrains\IntelliJ IDEA {version}\bin\idea64.exe.vmoptions but now these configurations exist in C:\Users{user}.IntelliJIdea{version}\config\idea64.exe.vmoptions.
You can get to this file from IntelliJ. On the Help menu, click Edit Custom VM Options. Then restart IDEA and it should update.
Note: It doesn't look like the value displayed in the bottom right will exactly match what you specify in the config file. Not sure why.
See also: How to increase the memory heap size on IntelliJ IDEA?
After Hours and hours searching.
On windows 10
Control Panel => System => Advanced system settings
System Properties => Advanced
Environment Variebles
_JAVA_OPTIONS -Xmx8192M
You changed the heap size of the project you were running within IntelliJ, not the heap size of IntelliJ itself, when you got to that popup.
You would set that in the run configuration for your project.
The startup options change the heapsize of IntelliJ itself, which is not shown on screen constantly.
I have just realised that the memory indicator which is showing the values are coming from 32bit vmoptions file while I'm running the 64 bit idea. And hence the indicator is not showing the correct values.

java.lang.OutOfMemoryError: Java heap space intellij

I have tried various workarounds but still facing the same issue.
Below I have been using till now.
-Xmx1024m -Xms1024m -XX:MaxPermSize=1024m -DENV=uat -DENV_INSTANCE=uata
Please help.
Go to Help -> Edit custom VM options
Put/replace -Xmx2g in here to increase max heap size to 2 gigabytes for example.
Close the file and restart IntelliJ.
See also How to increase Heap size of JVM

Apache Ignite off heap memory not working(in my guess)

I am developing simple distributed in memory key-value storage service.
In my case, I embed Ignite as using maven dependancy.
The application have simple controller, which is get and put API.
Get API is get object from ignite cache, Put API is put object to ignite cache.
Anyway, I do load test and I monitored jvm status using visual vm, I observed each heap area(e.g eden, suv, old) using visual gc plugin and direct buffer using buffer monitor plugin.
when I started load test, The eden area filled gradually and moved old area, not direct buffer. when the load test is end, direct buffer only use 150kb, but old area used 512m.
Image by visualGC
Image by buffer monitor plugin
※data size might be 500mb.
I guess, the direct buffer almost not used. why? hear is my configuration
-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1g -Xmx1g -XX:MaxDirectMemorySize=6g -XX:+AlwaysPreTouch -XX:NewSize=512m -XX:GCTimeRatio=4 -XX:InitiatingHeapOccupancyPercent=30 -XX:ConcGCThreads=4 -XX:+UseParNewGC -XX:+UseTLAB -XX:+ScavengeBeforeFullGC -XX:MaxNewSize=512m -XX:MaxMetaspaceSize=128m -XX:CompressedClassSpaceSize=32m -XX:SurvivorRatio=6 -XX:+UseConcMarkSweepGC -XX:+UseCMSInitiatingOccupancyOnly -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+CMSScavengeBeforeRemark -XX:ParallelGCThreads=6 -XX:MaxTenuringThreshold=5 -XX:MaxGCPauseMillis=1000 -XX:+DisableExplicitGC -XX:+ExplicitGCInvokesConcurrent -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:/data/log/catalina/cc.rnd.subnode1/GC.log -XX:+CMSClassUnloadingEnabled -Dspring.profiles.active=production
Ignite uses sun.misc.Unsafe for storing data in off-heap space. This gives maximal performance and flexibility, but it's not reflected in monitoring tools. Direct buffers used mostly in communication between nodes. You may observe memory consumption by analyzing java process size and used heap - with large data, process size will be much bigger than heap.
If you use Apache Ignite 1.x version, you need to configure off-heap. 2.0+ versions use off-heap by default.

Idea IntelliJ 14.1 Out of memory

Has someone experienced this?, what value would you suggest for Xmx?
Extra info: It is running in 32 bit (idea.exe)
That depends on the work that you do with IntelliJ (if you work much with larger files, then you should increase the memory more than if you only work with smaller files or projects). I have set Xmx to 2048 MB.
Ok, I managed to make it run with the following configuration in idea64.exe.vmoptions:
-Xms128m
-Xmx1512m
-XX:MaxPermSize=500m
-XX:ReservedCodeCacheSize=225m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
I switched over 64 bit (idea64.exe), the IDE starts, and seems that it has enough memory to load 4 projects with their web applications each.

Error initializing JVM

I am getting "Could not reserve enough space for object heap" error when I am trying to start hybris server.
I have set
wrapper.java.additional.1=-Xmx1G
wrapper.java.additional.2=-XX:MaxPermSize=1024M
My machine is 64 bit 8GB RAM Windows
I faced the same problem once, The problem in my case was that too many other Applications were running on my system.
So go to the task manager and check the memory available use.
Close some applications and try running.
Also if you are using eclipse Then, In your eclipse.ini file (this is beside the eclipse executable), replace -Xmx256m with -Xmx1024m (or Xmx512m).
This is not compulsory but in certain cases it works.
If you are using some extension then,
Open YOURPATH/config/local.properties file.
Add the following entry:
config/local.properties
build.parallel=true
Save the file.
(In cases where we have multiple cores in the machine, we can tell hybris to utilize these by building in parallel and in certain cases this too works)
I too faced the same probelm. I followed below steps and set the max heap size to 1GB.
Add the following content to local.properties
tomcat.generaloptions=-Xmx4G -ea -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dorg.tanukisoftware.wrapper.WrapperManager.mbean=true -Djava.endorsed.dirs="%CATALINA_HOME%/lib/endorsed" -Dcatalina.base=%CATALINA_BASE% -Dcatalina.home=%CATALINA_HOME% -Dfile.encoding=UTF-8 -Dlog4j.configuration=log4j_init_tomcat.properties -Djava.util.logging.config.file=jdk_logging.properties -Djava.io.tmpdir="${HYBRIS_TEMP_DIR}"
ant clean all
start hybrisserver
Reference
https://launchpad.support.sap.com/#/notes/0002437669