Forums Register Login

How to increase Heap Space

+Pie Number of slices to send: Send
Hello Friends,
I want to increase the Heap Space for my application.I have tried the following two options.It doesn't work after creating the Jar file.
-------------------------------------------------------------------
1] Process p = Runtime.getRuntime().exec("java -Xms32m -Xmx1024m WelCome");

I have written one class naming as StarrApp which contains the above Statement.I have added this(StratApp) class name in the Manifest file.But it does not work while creating jar.It don't get the WelCome file.Can you tell me how to use the WelCome class file within the Jar file in the above statement.
-------------------------------------------------------------------
2] Desktop desk=Desktop.getDesktop();
desk.open(new File("Test.bat"));

I have written above two statement in the StartApp.

Test.bat file contains the follwing statement.
java -Xms32m -Xmx1024m WelCome

After creating the jar file it doesn't work.

But it is also not working .
-------------------------------------------------------------------
Please let know the Solution ASAP.

Thanks and Regards,
Pradip
padwal_pradip@yahoo.com
pradip_padwal_coep@yahoo.com
+Pie Number of slices to send: Send
Welcome to the JavaRanch.
Have you tried reading the output and error streams of your process so you can see if there are any errors? I'd be willing to bet that the process can't find the class you are trying to execute.
+Pie Number of slices to send: Send
Hello Sir/Madam,
Thanks for your valuable reply.yes, it is right that the following command is unable to find the WelCome Class after creating the jar.

Process p = Runtime.getRuntime().exec("java -Xms32m -Xmx1024m WelCome");

If I will provide that WelCome Class file externally then it works.Can you tell me that how to use the class file within the jar and pass that file in the above command

Thanks and Regards,
Pradip
padwal_pradip@yahoo.com
+Pie Number of slices to send: Send
What do you mean by "the jar"? The command has no "-classpath" option that would point to any jar file, so any classes contained in jar files are not available to it.

When you add the "-classpath" option, be sure to use absolute paths, not relative paths.
+Pie Number of slices to send: Send
Hello Sir/Madam,
I have a need to increase the Heap Space of my application.
I have used the following command.
Process p = Runtime.getRuntime().exec("java -Xms32m -Xmx1024m WelCome");
---------------------------------------------------------------------
My Problem :
When I have written this command[above Process to execute command] in the main method of the WelCome class[WelCome Class the class which contains the main method for my application].
When I have created the Jar file of my application[Jar file-- It is a compressed file containing the all class files or Images].
When I have tried to run the Jar file by dubble clicking on it.after that it is unable to come out of loop. It calls the main method again and again.

Thanks and Regards,
Pradip
+Pie Number of slices to send: Send
Wait a minute. You want to increase the heap space of the current process? It can't be done.
It sounds like your jar is configured to start the Welcome class which spawns another process that starts the Welcome class which starts another process which starts the Welcome class. . .
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1267 times.
Similar Threads
Problem with processing data files of size larger than 350 MB
Memory heap error
heap size
Exectuion throwing Out of Memory exception
How to increase heap space
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:36:15.