How can I make Java application run with more memory? - java

I have a computer with 32 GB of RAM.
I am testing a software and I can see that it starts to work slowly when task manager says that it is using more than 6000 and something MB.
In the log file, I can see:
name of the application, running on 8 cpu cores and 6367MB memory.
I have followed this tutorial and setted 24576MB but it still doing the same.
I just have the binaries (.exe files), not the code.
Any solution? Thank you.

Resolved. I don't know if it can help anyone but in my case I had to modify a .conf file on the etc folder. The developer gave me the answer.

Related

Error occurred during initialization of VM, Could not reserve enough space for object heap

I tried to make a Minecraft Server, using the suggestions I've seen people telling others to use the Paper API. So I got all the files, and I allocated 512 MB of ram to it (using -Xmx512M), and it runs completely fine! But it bumps into the limit of RAM too much, so I tried to push it to 3 GB (using -Xmx3G). (A bit excessive, for what I'm using it for, but it'll help me sleep at night, knowing I have a server that's not running into issues) but then I run into the problem where Java simply does not want to start.
I experimented a bit, found that anything higher than 1.5G and Java starts having problems. Could not reserve enough space for 3145728KB object heap
.
So I went looking around, and found people saying "Add an Environment Variable to the System Variables with _JAVA_OPTIONS and -Xmx3G" and whatever, and it appears to not change anything for me. Java still doesn't want to start. Does anyone know how this is? I can't seem to update my Java to any higher version, assuming mine was outdated. So it can't be an update, and not everyone runs into this issue because a server manager once told me their server ran with 10GB of ram.
I'd ask them, but I've lost contact, so I'm asking here instead.
You may be using a 32-bit Java installation. Check which Java is being executed and install/use the 64-bit version.
https://java.com/en/download/manual.jsp
Make sure you're running 64 Bit Java. Otherwise, go to the link above and get the Windows 64-Bit Offline download. then run that. Immediately fixed it for me.

How do you analyze Domino snap files?

The Domino server crashed with a java outofmemory error (HTTP). It generated a snap trc file (Snap.20160426.111944.4212.0007.trc). How can this be analyzed? It looks like IBM does have a TraceFormat jar file but that ships with Websphere from what I can tell and not with Domino (there is a TraceFormat.dat file in Domino).
Any suggestions on where to get this?
Howard
That's strange. I've never seen such a file on any Domino server. I'm more used to NSD files, which are a pain in the a** to read, but can at least help form an idea of what the server was doing around the time of the crash.
Anyway, one thing to know is that Domino ships with ridiculousy low default settings for JVM memory allocation. You may want to check the notes.ini for the parameter HTTPJVMMaxHeapSize : chances are it is set way below the actual capacity of the machine.
While you're there you could as well check other JVM related parameters such as JavaMaxHeapSize

Some `jar` files do not run in Windows 7

We have bunch of jar files that are Java applications and run just fine. There are a few however that do nothing although it is expected to run :) with a GUI.
Is this a common issue with jar files that some have difficulties to run?
The OS is Windows 7 and the example not working jar is whitebox a free GIS application, BTW.
We reiterate that we have many jar applications that run like a charm in the above system. This means that it should not be a problem with Java installation (latest update 7u40 exists in the system).
We checked almost all jar failure related topics but no one discussing the issue above which is happening for some applications.
We also mention, we uninstalled and reinstalled java many times but with no success. The application whitebox does nothing. In one try, it did run and when we closed it. And we are since then trying to run it again but nothing is happening! Even nothing appears in the running Processes!
We examined command line and double click. No success. The file type association is correct. Furthermore as we said others are working just fine.
The problem reported was due to inadequate RAM. Whitebox requires 2GB RAM to run smoothly. While this is huge we could run it on an old laptop with only 1GB RAM. The solution was to increase the size of paging file (virtual memory) into the range 1024MB and 2048MB. We also moved its location from C drive into other drives. We the settings mentioned it runs without any problem. We have tried it many times and happy to report for this case the problem is now completely solved.
Conclusion:
For some Java applications if something happend as described in the question it may be due to memory requirement. In this case increasing virtual memory could solve the problem without a need to buy additional RAM.

java.lang.OutOfMemoryError: Java heap space running applet

I'm developing a graphic user interface with NetBeans IDE 7.0.1. I need to operate with long Strings (about 1 GB) and I've changed the start up configuration parameter to:
-J-Xss512M
-J-Xms4G
-J-Xmx12G
-J-XX:PermSize=4G
-J-XX:MaxPermSize=8G
When I execute the applet I receive the "java.lang.OutOfMemoryError: Java heap space" exception. I've checked th point of the exception and at that moment, the applet was trying to concatenate two Strings, one of them of 550.000.000 length and the other 68.000.000
If I change the parameters above, it changes nothing on the applet exception.
My computer has 16 GB RAm so I think this is not the problem. Maybe some applet configuration?
Can you help me?
Thanks a lot
What operating system are you running on? If its a 32 bit one you wont be able to address more than around 4G of RAM (less in practice, especially on a Windows machine).
The second point here is the config you're changing is, I think, for NetBeans - not for the applet. If so (and I'm not sure how this works in NetBeans) then you need to alter the memory settings for your Applet itself, not for NetBeans.
This is typically done via run configuration settings for the app/applet etc you're trying to run.
Hope this helps!

My java application running as a service is causing disk full error on windows 2008. Ca't see anything from the explorer

I have a Java server that I wrote myself running as a service. Right now looks like the application is somehow eating all my drive space at a 1GB per hour rate.
After a stop of the service the disk space becomes available by itself (I'm not deleting anything). From the application I'm not creating any files or writing to disk besides logs or the database but those are not growing so fast.
The big problem with this is that I can't find any file or folder that is eating up all my drive. I don't know if it is a system file that I don't have access to from the explorer or if it's a virus or a JVM bug. I'm using Oracle JVM 64 bit from JDK 7 update 7.
I appreciate a lot any help you can provide me with this. I have never seen something like that before.
Thanks.
Here are the possible pointers:
Check if your disk is full because of other applications (possibly malware)
Check if there are any IO operations from your application
Check if your local repository (like .m2, .gradle/caches) are filling it up during build with transitive dependencies
If possible, add couple of loggers to display the size of your hardisk using new File("/").getTotalSpace(); along with RAM details and watch how they are changing
Finally if nothing works out, try your application in another machine

Categories

Resources