Unable to create Java Virtual Machine Error while running Sonar analysis - java

Version Used
SonarQube 7.3 integrated with TC using SonarScanner using version sonar-scanner-msbuild.4.0.2.892
Error received
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.*
Invalid maximum heap size: -Xmx14336m*
The specified size exceeds the maximum representable size.*
Process returned exit code 1*
The SonarQube Scanner did not complete successfully*
Creating a summary markdown file…*
Post-processing failed. Exit code: 1*
Process exited with code 1*
Steps Taken
I tried various values of Xmx and elastic search Xmx values to get over the error ranging from 7000M to 10000M, but the MSbuild step which is in between the begin and end analysis steps runs for almost 6 hrs and fails at the end analysis step. Just to add into perspective I am scanning over 10M Loc

Related

I've got java.lang.OutOfMemoryError: Java heap space testing ActiveMQ by JMeter on Linux build agent

I run JMeter test for ActiveMQ using Linux build agent I've got java.lang.OutOfMemoryError: Java heap space. Detailed log:
at java.util.Arrays.copyOf(Arrays.java:3332)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124) ~
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
at java.lang.StringBuilder.append(StringBuilder.java:136
at org.apache.jmeter.protocol.jms.sampler.SubscriberSampler.extractContent(SubscriberSampler.java:282) ~[ApacheJMeter_jms.jar:5.3]
at org.apache.jmeter.protocol.jms.sampler.SubscriberSampler.sample(SubscriberSampler.java:186) ~[ApacheJMeter_jms.jar:5.3
at org.apache.jmeter.protocol.jms.sampler.BaseJMSSampler.sample(BaseJMSSampler.java:98) ~
at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:635) ~[ApacheJMeter_core.jar:5.4]
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) ~[ApacheJMeter_core.jar:5.4]
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) ~[ApacheJMeter_core.jar:5.4]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) ~[ApacheJMeter_core.jar:5.4]
I've already allocated maximum HEAP memory (-Xmx8g), but it doesn't help. Yet the same test with the same configuration on Windows build agent passed without Out of memory error.
How can it be handled? Maybe some configuration should be done for Linux machine?
Are you sure your Heap setting gets applied on Linux?
You can check it my creating a simple test plan with single JSR223 Sampler using the following code:
println('Max heap size: ' + Runtime.getRuntime().maxMemory() / 1024 / 1024 + ' megabytes')
and when you run JMeter in command-line non-GUI mode you will see the current maximum JVM heap size printed:
In order to make the change permanent amend this line in jmeter startup script according to your requirements.
The issue was resolved after updating Java to 11 version on Linux machines.

HBASE error : Unrecognized VM option 'UseConcMarkSweepGC'

I have jdk-15.0.1 on my laptop, and have installed HBASE (hbase-2.2.6 version).
I followed every steps to install HBASE on this link : https://www.learntospark.com/2020/08/setup-hbase-in-windows.html
The problem is that when I try running HBASE in my command line using :
start-hbase.cmd
I get the following error message :
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
ERROR: Could not determine the startup mode.
As a beginner, I tried scouring around for information, but nothing that matches my problem.
I would be glad for any help you could give me.
CMS garbage collector is removed in JDK 15, thus UseConcMarkSweepGC too is removed.
JEP 363: Remove the Concurrent Mark Sweep GC
So, either you should switch back to java 8 or 11, or you should modify below line:
set HBASE_OPTS="-XX:+UseConcMarkSweepGC" "-Djava.net.preferIPv4Stack=true"
with
set HBASE_OPTS="-Djava.net.preferIPv4Stack=true"

Jenkins-Maven build failed: Could not find the main class: jenkins.maven3.agent.Maven32Main. Program will exit

My Jenkins build is failing since a couple of days ago. When I compare the previous success build, I found that maven32-agent-1.8.1.jar updated to maven32-agent-1.12-alpha-1.jar similarly maven3-interceptor-commons-1.8.1.jar to maven3-interceptor-commons-1.12-alpha-1.jar.
JDK : JDK_6u45
Maven : 3.2.3
The error I get now is :
xx/var/lib/jenkins/tools/hudson.model.JDK/JDK_6u45/bin/java -XX:MaxPermSize=512m -cp /usr01/var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-agent-1.12-alpha-1.jar:/usr01/app/apache-maven-3.2.3/boot/plexus-classworlds-2.5.1.jar:/usr01/app/apache-maven-3.2.3/conf/logging jenkins.maven3.agent.Maven32Main /usr01/app/apache-maven-3.2.3 /var/cache/jenkins/war/WEB-INF/lib/remoting-3.14.jar /usr01/var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven32-interceptor-1.12-alpha-1.jar /usr01/var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12-alpha-1.jar 85426
Could not find the main class: jenkins.maven3.agent.Maven32Main. Program will exit.
ERROR: Failed to launch Maven. Exit code = 1
Started calculate disk usage of build
Finished Calculation of disk usage of build in 0 seconds
Started calculate disk usage of workspace
Finished Calculation of disk usage of workspace in 0 seconds
Finished: FAILURE
Any solution for this?

JAVA(TM) binary has stopped working while ant converts .jmx to .jtl

I'm trying to generate HTML reports of jmeter files using apache ant. while running the test .jmx file tries to convert itself into .jtl file, at that time java binary has not working pop appears and build fails.
D:\softwares\apache-jmeter-2.13\apache-jmeter-2.13\extras>ant -Dtest=RetailerPor
tal
Picked up _JAVA_OPTIONS: -Xmx256M
Buildfile: D:\softwares\apache-jmeter-2.13\apache-jmeter-2.13\extras\build.xml
run:
[echo] funcMode = false
[jmeter] Executing test plan: D:\softwares\apache-jmeter-2.13\apache-jmeter-2
.13\extras\RetailerPortal.jmx ==> D:\softwares\apache-jmeter-2.13\apache-jmeter-
2.13\extras\RetailerPortal.jtl
_message_xalan:
xslt-report:
BUILD FAILED
D:\softwares\apache-jmeter-2.13\apache-jmeter-2.13\extras\build.xml:132: input f
ile D:\softwares\apache-jmeter-2.13\apache-jmeter-2.13\extras\RetailerPortal.jtl
does not exist
Total time: 17 seconds
According to the output it fails during execution of the JMeter test, most likely due to low Java Heap Size value (-Xmx256M). Check out jmeter.log file - it usually contains all the necessary information.
Add the following line to <jmeter> section of your build.xml file:
<jvmarg value="-Xmx1234M"/>
or set it via ANT_OPTS environment variable on OS level like:
set ANT_OPTS=-Xmx1234M
Replace 1234 with memory size (in megabytes) you want to make available to JMeter (I would go for 70% - 80% of your total physical RAM amount)
See 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure guide for more JMeter tweaks, tips and tricks
Increasing the RAM size works fine.
Please check about Test.jtl file which is created in apacheant\bin. You might have created a new test documet and replaced its name with Test.jtl simply... Try to open it and save as it with .jtl extension... Make sure you've removed .txt.

System Tray - setting image dynamically is unstable

Today I tried to change system tray image dynamically as :
getTrayIcon().setImage(imageB);
But sometimes I have error thrown as :
Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 73 (X_GetImage) Serial number of
failed request: 6724 Current serial number in output stream: 6724
Java Result: 1
or this error :
The program 'java' received an X Window System error. This probably
reflects a bug in the program. The error was 'BadMatch (invalid
parameter attributes)'. (Details: serial 1139091 error_code 8
request_code 73 minor_code 0) (Note to programmers: normally, X
errors are reported asynchronously; that is, you will receive the
error a while after causing it. To debug your program, run it with
the --sync command line option to change this behavior. You can
then get a meaningful backtrace from your debugger if you break on
the gdk_x_error() function.)
Java Result: 1
... I have no idea where that error comes from so I really like to hear your opinion of maybe how to optimize/workaround the code?
OS linux x64 (XFCE4)
JRE 1.7.0_72-b14
JDK 1.7
Thanks

Categories

Resources