I am getting this error message while trying to use Testng in Eclipse? - eclipse-plugin

I am getting the error message such as stack overflow, heap memory error and similar messages after trying to use TestNG. And after installing TestNg the Eclipse feels heavy and became very slow to respond. and throwing this error message.

An error of such kind Stackoverflow and heap memory error occurs because of physical lack of resources such as lower Ram or slower processor. So the only solution to this was to allocate more memory to eclipse IDE. you can allocate more memory to eclipse by finding the eclipse.ini file in your directory where you have installed it. After finding the file, the file should be in notepad. open the file in notepad and edit the memory allocated. there are two things you need to change. Xms and XMX, which is minimum and max memory. I made mine from 256m to 512m for XMS and from 1024m to 2048M. But make sure you allocate only the memory which is spare. otherwise your PC might crash. Hope this helps.

Related

java option xms doesn't seem to go as expected What could be the problem? [duplicate]

I have a java program running in centos Box.
My -Xmx and -Xms set to 4000 Mb.
The program works fine.
But when i do free -m , the used memory is showing as 506 MB. As per my understanding , XMS memory should be reserved for JVM.Why does free command not showing the java used memory ?
I have also done jstat -gccapacity $(pidof java) and there NGCMN and NGCMX updated and have the same value ?
Any support would be helpful.
I'm running my program as java -Xms41000m -Xmx42000m -jar
Even when -Xmx and -Xms set to the same value, the space reserved for Java Heap is not immediately allocated in RAM.
Operating System typically allocates physical memory lazily, only on the first access to a virtual page. So, while unused part of Java Heap is not touched, it won't really consume memory.
You may use -XX:+AlwaysPreTouch option to forcibly touch all heap pages on JVM start.

ilink64 Error: Fatal: Malloc of 65536 bytes failed

I'm transfering project for C++ Builder 6 on Embarcadero RAD Studio 10.4 and change platform with x86 on x64. My project include five *.dll and two *.exe files.
I success transfer four *.dll on x64 platform, but fifth *.dll report about error. When *.dll - file make, I get message about error: "Out of memory". I visited url:
http://docwiki.embarcadero.com/RADStudio/Sydney/en/Handling_Out_of_Memory_Errors
and found out, that in my happening overflow three heap:
Code Heap Size
Dwarf str Heap Size
Info Heap Size
Little by little I enlarged size all heaps. But, soon I reached limitation: "[ilink64 Error] Fatal: Malloc of 65536 bytes failed in ........\bins\Win64\Debug\my_dll.ildw_str, line 6"
About this signaling Dwarf str Heap Size.
I visited url:
https://stackoverflow.com/a/37537734/9494441
and maked all tips.
I tryed:
Setted Large Address Aware flag with the lamarker tool
Replace ilink32.exe and ilink64.exe program RAD Studio with version 10.4 on version 10.2.3
Incremental linker disabled/enabled
Manually removing all files in /debug
all rebuild
add files to the antivirus exclusions ilink32.exe and ilink64.exe
Me didn't help nothing. How fix this problem? Thanks!
This is happening only in debug, right?
4 options you have:
Reduce the memory of the sections you are allocating more than you project needs. Not to allocate more memory than neede in the other sections.
Reduce all the symbols your modules are expose to. I've been told that the linker does not detect duplicates and same symbols get included again and again making the things worse. If the project is old and have a poor include policy you might have something to work on there
Compile all in release and enable debug info only on the modules you are going to debug.
Try to use 10.3.1 where C++ win64 was not yet C++17. In 10.3.2 Win64 was upgraded to C++17 making the linker problem more likely to happen.

gc memory overhead exceeded in jmeter

My test execution shows "gc memory overhead exceeded" exception in linux cent os 7. I changed jmeter.bat's heap max size 6g and min size as 512m. I am not used any listeners, preprocessor, http header manager. Used regular expression extractor for 2 samplers and constant timer as common. I run my test in terminal and store result in jtl file. I run it for 250 users, rampup period as 1 and scheduler as 5400 seconds. But still issue persist..
System configuration:
Ram 8 GB
CPU octa core 3.12 GHz
Swap memory 16 GB
You say that you changed jmeter.bat, but the problem is on Linux, which doesn't use jmeter.bat. Unless it's a typo, try to change jmeter or jmeter.sh (whichever one you use to invoke JMeter).
Generally I would not recommend more than 2GB for moderate use, and 4GB for heavy use. For instance my settings are:
HEAP="-Xms4096m -Xmx4096m"
and I can run up to 300 concurrent users with a lot of samplers/heavy scripting even in GUI mode. Setting larger heap may cause larger pauses on GC, which can cause the exception you are getting.
After you start JMeter, run the following command to make sure the memory settings are indeed as you expect them to be:
ps -ef | grep JMeter
I actually changed Xmx in jmeter.bat file instead of jmeter.sh file since i used linux for this test. Jmeter.bat is supported in windows os and jmeter.sh is supported for Linux os. So that the above mentioned error occurred. Once I changed it in jmeter.sh file it works perfectly.

How can I restart JVM on OutOfMemoryError _after_ making a heap dump?

I know about the -XX:+HeapDumpOnOutOfMemoryError JVM parameter. I also know about -XX:OnOutOfMemoryError="cmd args;cmd args" and that kill -3 <JVM_PID> will request a heap dump.
Question: How can I make sure that I, on OutOfMemoryError, first make a full heap dump and then force a restart (or kill) after the dump is done? Is my best bet -XX:OnOutOfMemoryError="kill -3 %p;sleep <time-it-takes-to-dump>;kill -9 %p"?
java -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError="kill -9 %p" TestApp
JVM will dump heap first, and then execute OnOutOfMemoryError commands (proof).
If you just want to shutdown you can use one of the following parameters:
-XX:+ExitOnOutOfMemoryError
-XX:+CrashOnOutOfMemoryError
The VM arguments were added in Java version 8u92, see the release notes.
ExitOnOutOfMemoryError
When you enable this option, the JVM exits on the
first occurrence of an out-of-memory error. It can be used if you
prefer restarting an instance of the JVM rather than handling out of
memory errors.
CrashOnOutOfMemoryError
If this option is enabled, when an
out-of-memory error occurs, the JVM crashes and produces text and
binary crash files.
Enhancement Request: JDK-8138745 (parameter naming is wrong though JDK-8154713, ExitOnOutOfMemoryError instead of ExitOnOutOfMemory)
I bet the runtime sets a specific errorlevel on crash. Check for that return code and rerun the program in that case. You should perhaps put that into a script.
The sun jre allows you to heap dump on oome, perhaps openjdk does too.

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