Eclipse always exit when used in a virtual machine - eclipse

I use ubuntu16.04 in VMware for learning Hadoop. The eclipse is Eclipse IDE for Java Developers at 2020.03 for linux_64.
And when use eclipse to write some java code, the IDE usually exits by itself without any error. And the eclipse is too slow when I use it. I guess that whether the memory is not enough for using IDE. But I found the memory is free when I check it. I allocated 2G of memory for ubuntu16.04.
And I search for this problem on web. I found many people believe the problem is eclipse caused. So they come up with a way to edit eclipse.ini.
-Dorg.eclipse.swt.browser.DefaultType=mozilla
Add this command to the last line of eclipse.ini.
Unfortunately, it doesn't work. So Do u know why? Should I allocate more memory for VMware?

Related

Why does Eclipse CPU usage increase when I run an application?

I run my Java application in Eclipse and see these two thing in Task Manager:
Before I start my application, Eclipse uses ~0% CPU. What exactly does Eclipse do after my program started?
If I run my application without Eclipse, will there be any difference in my Java process CPU usage in the case that my JVM settings are the same with Eclipse?
Eclipse has to read your program output to display it in the console, for example, which can take a bit of resources, especially if your program generates lots of output and/or long lines of output (in my experience, the Eclipse console is quite slow). I suppose you're not running in debug mode, in which case Eclipse would have to do more to handle the debugging.
So your application running outside Eclipse may go a bit faster, yes.
You can of course run something like jvisualvm to get a thread dump of Eclipse while your program is running to find out exactly Eclipse is doing.

Attaching GDB to Eclipse to debug JNI C++ code

I'm having problems debugging a JNI application. I've read several threads in StackOverflow, like this one, this one or this one. I've also tried to start gdb in a separated shell and attach it to the running java process. In both cases, the problem is the same: GDB can't find the sources to debug. Things tried
Add "dir" line to gdbinit, pointing to C++ sources folder
Adding the C++ sources folder to the GDB debbuging configuration in Eclipse, in the "Sources" tab.
Adding set environment LD_LIBRARY_PATH=/path/to/library.so, being library.so the library file built from C++ source files
Attach ddd to the java process, but then I get an error because pthread_join.c is not found in the working directory. I don't have this file in my hard disk. I don't know what is this about.
Nothing worked. I've spent several days on this. I know my bug is in the C++ code called by the JNI wrapper, but I can't debug it. Any hints? If helps, I'm running Eclipse Juno in Debian 7 under a Parallels VM on Mac OS.
Many thanks in advance,
You need to have debug information in your native library. You should pass -g to your compiler and linker to have this information in the executable. You may also want to add -O0.
As an alternative to attaching to the Java process, you can create a C++ app and debug it directly. You just need to link in the functions you want to test. In the main function, create the VM, register the functions with RegisterNatives, and kick off a Java test class the uses them.
Hopefully, the debugger has no problem finding the sources since it is just part of the normal compile/link/debug loop of a C++ app.
I would suggest to start with the latest ADT bundle. You can even download the Mac version, so you will not even need Parallels (see a detailed instructions). Then, choose Debug Android Native Application in launch menu.

Eclipse debugger stops working randomly

I have been working on a project that requires rigorous debugging at each step and I notice that my debugger just randomly stops working from time to time and does not respond to any of the breakpoints.
I tried restarting eclipse and unplugging my device over and over. Any particular reason this might be happening? Its extremely frustrating and I couldn't think of a better place to post this query.
Many a thanks in advance!
I know this is an old question. But I had that eclipse suddenly stopped working, i.e. died before even executing one line. I restarted VM and eclipse multiple time. Then I stumbled here. Thank you, it got my mind thinking.
For all major issues with eclipse, not loading, freezing or debugger fuck up (that is not because of your code :D ). Try the following line:
./eclipse -clean -clearPersistedState -refresh
First I would make sure your eclipse is not running out of heap space memory. If necessary increase the heap memory using the -mx Java command line flag. Running out of memory can cause various instability problems such as the one you describe.
-xms is the start memory (at the VM start), -xmx is the maximum memory for the VM
eclipse.ini : the memory for the VM running eclipse
jre setting : the memory for java programs run from eclipse
catalina.sh : the memory for your tomcat server

NetBeans 6.9 and javaw.exe uses > 50% of CPU

When i work with NetBeans 6.9 for PHP the javaw.exe is occupying more then 50% of CPU and about 450mb ram (ram is not really the problem) but CPU tend to overheat.
I had jdk6.5 for 64bit sys and now updated to latest jdk6.21 but it is the same, the CPU is always near 100%
is there a solution to this high requirements of javaw.exe?
OS: Win7 64bit
UPDATE:
I installed the NetBeans 6.7.1 the one that worked EXCELLENT to compare with 6.9.
so:
6.7.1 less memory usage by javaw.exe then 6.9 but cpu still in use > 50% nonstop
then:
I installed the JDK6_21 32bit cause i had 64bit and in the config (netbeans.conf) file set the path of the 32bit JDK.
6.9 less memory CPU still to high
6.7.1 less memory NO CPU usage when idle
SO im gonna downgrade to the 6.7.1 because it works for me and i dont really need the 6.9 cause i dont really use the new features that offers.
btw. 6.8 was crashing with no reason, so that option is out.
You could configure Netbeans to run java.exe instead of javaw.exe, and see if the behavior is still the same.
If it's the same, this is clearly a Netbeans problem, so I would suggest reporting this problem to Netbeans, since this is the way bugs get usually fixed :).
One thing you should consider doing on Netbeans (and Eclipse... and $insertOtherIDE) is to turn off automatic project indexing, compile on save, and other things that cause lots of work to happen in the background without your prompting.
In Netbeans 6.9, external scanning/indexing tends to be the biggest culprit when dealing with projects of considerable size. Try disabling it by (and these instructions are for the Mac, I assume they are similar on Windows)
Go to Preferences
Click on Miscellaneous
Click on the Files Tab
Deselect "Enable auto-scanning of sources"
After this you can force NB to re-scan by clicking Source->Scan For External Changes in the menu (might be Mac specific, again).
See if that helps you out at all...
I had the same problem (Win7 64bit). Everything was working, but suddenly (I think after refactoring some stuff) javaw.exe was constantly using the cpu.
After clearing the netbeans cache, everything was working again (delete the contents of the cache folder and restart Netbeans).
%UserProfile%\.netbeans\6.9\var\cache\
I had to do this before after getting strange errors in Netbeans and most of the time it solved the problems. I think sometimes it just gets out of sync.

free memory netbeans plugin

Is there any plugin for NetBeans to free memory manually?
NetBeans' core has this feature but it is not complete.
You can't free memory whenever you want in a Java application! The only way to free memory in Java is to call "System.gc()", but this just suggests the Java Virtual Machine to run the garbage collector (the JVM is free to do the gc or not).
If you're running out of memory while running NetBeans you may want to modify the [netbeans]/etc/netbeans.conf and modify the line that starts with "netbeans_default_options". For instance:
netbeans_default_options="-J-Xms384m -J-Xmx512m -J-XX:PermSize=32m -J-XX:MaxPermSize=96m -J-Xverify:none"
Anyway remember that modifying the memory for NetBeans does not affect the applications you run with NetBeans, because those run in another Java Virtual Machine.
You dont any plugin just click on the default memory bar in the toolbar
this may be relevant and helpful...
Had a similar memory problem on my Linux Debian.
Here is how to fix it:
run a terminal
log in as root
type crontab -e
scroll to the bottom or the file and type * * * * * sync; echo 3 > /proc/sys/vm/drop_caches
This magic line cleared all unused ram every minute. It removed the unused memory NetBeans was producing (including any other memory-consuming programs).
This should work on most UNIX like OS's.
plz tell me if it works...
http://www.omegat.org/en/omegat.html