• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to increase Heap Space  RSS feed

 
Pradip Padwal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Joe Ess
Bartender
Posts: 9439
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pradip Padwal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pradip Padwal
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Joe Ess
Bartender
Posts: 9439
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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. . .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!