Memory allocation for external process in JBoss - jboss

We are using ImageMagick launched by a JBoss EJB by the way of im4Java, to produce image files. im4Java is an Java interface to imagemagick, launching external process with java.lang.ProcessBuilder. After few successfull runs, we are blocked by a :
java.io.IOException: Cannot run program "/usr/local/bin/convert": java.io.IOException: error=12, Cannot allocate memory
It seems not to be an ImageMagick issue, because if we launch the same process from command line, it runs perfectly. But more a Jboss memory allocation for an external process.
Any idea ?

Finally solved, but maybe not the best way. Indeed , we have used the solution of the overcommit_memory variable in Linux indicated by Ivan, and no problem any more. But we are not sure changing that this memory global settings would not affect the whole behavior of the system later, as it seems to allocate a lot more memory. Hopefully we do not run so often imagemagick from java code, so memory is released once imagemagick did his job.

Related

Eclipse always exit when used in a virtual machine

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?

Is it safe to recompile and replace executable, while a program is in execution?

If I run an executable, and during execution, I change the executable by recompilation, is it guaranteed that the program will continue execution as per the old executable? In theory, I understand that page faults can occur and hence, I expect changing an executable during execution, may not be a great idea. I have searched for an answer, but I have not got a satisfactory explanation.
Many systems will not allow you to do this. Systems that use the executable for paging will lock the file and prevent you from doing this while running.
Systems that do allow this, will have loaded everything from the executable into memory or secondary storage. So changing the executable while it is running will not affect the running program.

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.

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

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