Getting this error when trying to run one of the Xamarin.Forms navigation samples from GitHub (MasterDetailsPage)
Severity Code Description Project File Line Suppression State Error
java.lang.OutOfMemoryError. Consider increasing the value of
$(JavaMaximumHeapSize). Java ran out of memory while executing
'java.exe -jar "C:\Program Files
(x86)\Android\android-sdk\build-tools\23.0.3\lib\dx.jar" --dex
--no-strict --output obj\Debug\android\bin \MasterDetailPage\Droid\obj\Debug\android\bin\classes\classes.zip
"C:\Program Files (x86)\Microsoft Visual
Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v8.0\mono.android.jar"
obj\Debug\lp\0\jl\formsviewgroup.jar
obj\Debug\lp\10\jl\bin\classes.jar obj\Debug\lp\11\jl\bin\classes.jar
obj\Debug\lp\12\jl\bin\classes.jar obj\Debug\lp\13\jl\bin\classes.jar
obj\Debug\lp\14\jl\bin\classes.jar obj\Debug\lp\15\jl\bin\classes.jar
obj\Debug\lp\16\jl\bin\classes.jar obj\Debug\lp\17\jl\bin\classes.jar
obj\Debug\lp\18\jl\bin\classes.jar obj\Debug\lp\19\jl\bin\classes.jar
obj\Debug\lp\20\jl\bin\classes.jar obj\Debug\lp\21\jl\bin\classes.jar
obj\Debug\lp\3\jl\arch-core-common.jar
obj\Debug\lp\4\jl\arch-lifecycle-common.jar
obj\Debug\lp\5\jl\bin\classes.jar obj\Debug\lp\6\jl\bin\classes.jar
obj\Debug\lp\8\jl\bin\classes.jar obj\Debug\lp\9\jl\bin\classes.jar
C:\Users\me\AppData\Local\Xamarin\Xamarin.GooglePlayServices.Basement\8.4.0\embedded\classes.jar'
MasterDetailPageNavigation.Droid
I tried setting android:largeHeap to true in the AndroidManifest.xml
But the error didn't go away
I also tried to set the Java Max Heap Size to 1G in the Android Advanced Options under the project properties - the project builds without errors but that's about it, the emulator doesn't launch (or if I have it open nothing happens within it - the app doesn't start)
I read somewhere , that if the emulator doesn't start it means there isn't enough memory for it so it fails silently. I forget exactly the details.
But I have plenty of free RAM on my machine 12GB in total and between 6 - 8 GB avail, when visual studio is running.
The problem occurs while building the app not when running. Open the properties of the Android project and there Android options->Advanced you will find Java Max Heap Size. Using a value of 1G (for one gigabyte) should fix the memory problem.
I am trying my hands on the Stanford dependency parser. I tried running the parser from command line on windows to extract the dependencies using this command:
java -mx100m -cp "stanford-parser.jar" edu.stanford.nlp.trees.EnglishGrammaticalStructure -sentFile english-onesent.txt -collapsedTree -CCprocessed -parserFile englishPCFG.ser.gz
I am getting the following error:
Error occurred during initialization of VM
Too small initial heap
I changed the memory size to -mx1024, -mx2048 as well as -mx4096. It didn't change anything and the error persists.
What am I missing?
Type -Xmx1024m instead of -mx1024.
See https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html
It should be -mx1024m. I skipped m.
One more thing: in the -cp, the model jar should also be included.
... -cp "stanford-parser.jar;stanford-parser-3.5.2-models.jar"...
(assuming you are using the latest version).
Otherwise an IO Exception will be thrown.
There may be some arguments that are preexisting in the IDE.
In eclipse:
Go to-> Run as-> run configuration-> Arguments
then Delete the arguments that are used previously.
Restart your eclipse.
Worked for me!
I am getting error due to gmaven-plugin and groovy is giving error saying that groovy classpath could not find enough object heap space.I am using 32 bit system & Intellij idea ide. I have tried various options but could not resolve it ?
What i have tried are :
<configuration>
<argLine>-Xmx1024m</argLine>
</configuration>
Xmx256M -XX:MaxPermSize=512m
For 32 bit
-Xms1336m -Xmx1336m
I Got the same error,and resolved this by configuring in the run.conf.bat
Run the JVM with the configuring run.conf.bat in Jboss5x
If free memory is not available AS you are passing in the statement then please make changes in run.conf.bat
set "JAVA_OPTS=-Xms512m -Xmx512m -XX:MaxPermSize=256m
<configuration>
<maxmemory>1024M</maxmemory>
</configuration>
According to this IBM document about the Java heap size (along with some hints about setting the right heap size) the limits for Windows are:
• maximum possible heap size on 32-bit Java: 1.8 GB
• recommended heap size limit on 32-bit Java: 1.5 GB (or 1.8 GB with /3GB option)
MAVEN_OPTS="-Xms2048m -Xmx2048m -XX:PermSize=512m -XX:MaxPermSize=1024m"
Could anyone help me out in getting rid of this ?
thanks in advance. Publishing with my VisualStudio/ClickOnce I get always the following error.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Users\carlos\Documents\visual studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\publish\ConsoleApplication1.application resulted in exception. Following failure messages were detected:
+ Configuration system failed to initialize
+ Unrecognized configuration section startup. (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\dfsvc.exe.Config line 2)
The dfsvc.exe.Config is:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="false">
<supportedRuntime version="v4.0" sku="client" />
</startup>
</configuration>
Is something that I should install on my PC? Thanks again.
I found a solution,
I don't know exactly which was the fix, I did three steps:
1 - I repaired .net fx intallation
2 - Ran mage -cc to clear clickonce store
3 - Rebooted
thanks
I am deploying a large Java project on Sonar using "Findbugs" as profile and getting the error below:
Caused by: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError:
Java heap space
What i have tried to resolve this:
Replaced %SONAR_RUNNER_OPTS% with -Xms256m -Xmx1024m to increase the heap size in sonar-runner bat file.
Put "sonar.findbugs.effort" parameter as "Min" in Sonar global parameters.
But both of above methods didn't work for me.
I had the same problem and found a very different solution, perhaps because I'm having a hard time swallowing the previous answers / comments. With 10 million lines of code (that's more code than is in an F16 fighter jet), if you have a 100 characters per line (a crazy size), you could load the whole code base into 1GB of memory. I set it 8GB of memory and it still failed. Why?
Answer: Because the community Sonar C++ scanner seems to have a bug where it picks up ANY file with the letter 'c' in its extension. That includes .doc, .docx, .ipch, etc. Hence, the reason it's running out of memory is because it's trying to read some file that it thinks is 300mb of pure code but really it should be ignored.
Solution: Find the extensions used by all of the files in your project (see more here):
dir /s /b | perl -ne 'print $1 if m/\.([^^.\\\\]+)$/' | sort -u | grep c
Then add these other extensions as exclusions in your sonar.properties file:
sonar.exclusions=**/*.doc,**/*.docx,**/*.ipch
Then set your memory limits back to regular amounts.
%JAVA_EXEC% -Xmx1024m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m %SONAR_RUNNER_OPTS% ...
this has worked for me:
SONAR_RUNNER_OPTS="-Xmx3062m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m"
I set it direct in the sonar-runner(.bat) file
I had the same problem when running sonar with maven. In my case it helped to call sonar separately:
mvn clean install && mvn sonar:sonar
instead of
mvn clean install sonar:sonar
http://docs.sonarqube.org/display/SONAR/Analyzing+with+Maven
Remark: Because my solution is connected to maven, this is not the direct answer for the question. But it might help other users who stumple upon it.
What you can do it to create your own quality profile with just some Findbugs rules at first, and then progressively add more and more until you reach his OutOfMemoryError. There's probably only a single rule that makes all this fail because your code violates it - and if you deactivate this rule, it will certainly work.
I know this thread is a bit old but this info might help someone.
For me the problem was not like suggested by the top-answer with the C++ plugin.
Instead my problem was the Xml-Plugin (https://docs.sonarqube.org/display/PLUG/SonarXML)
after I deactivated it the analysis worked again.
You can solve this issue by increase the maximum memory allocated to the appropriate process by increasing the -Xmx memory setting for the corresponding Java process in your sonar.properties file
under SonarQube/conf/sonar.properties
uncomment below lines and increase the memory as you want:
For Web: Xmx5123m -Xms1536m -XX:+HeapDumpOnOutOfMemoryError
For ElasticSearch: Xms512m -Xmx1536m -XX:+HeapDumpOnOutOfMemoryError
For Compute Engine: sonar.ce.javaOpts=-Xmx1536m -Xms128m -XX:+HeapDumpOnOutOfMemoryError
The problem is on FindBugs side. I suppose you're analyzing a large project that probably has many violations. Take a look at two threads in Sonar's mailing list having the same issue. There are some ideas you can try for yourself.
http://sonar.15.n6.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-td4898141.html
http://sonar.15.n6.nabble.com/java-lang-OutOfMemoryError-Java-heap-space-td5001587.html
I know this is old, but I am just posting my answer anyway. I realized I was using the 32bit JDK (version 8) and after uninstalling it and then installing 64bit JDK (version 12) the problem disappeared.