472,362 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,362 software developers and data experts.

Java VM Heap

Hello,
do you guys know how to increase the maximum heap for the jvm?
I know about giving to apps args like:
-Xmx<size> set maximum Java heap size

But i would like to give to my VM maximum heap defaults.
Any application that will use my Vm is set as default to -Xmx256M; without
setting it manually for each app.

thnx!
Kimbuba.
Jul 17 '05 #1
4 11668
"kimbuba" <ki*************@yahoo.it> wrote in message news:<vn*******************@tornado.fastwebnet.it> ...
Hello,
do you guys know how to increase the maximum heap for the jvm?
I know about giving to apps args like:
-Xmx<size> set maximum Java heap size

But i would like to give to my VM maximum heap defaults.
Any application that will use my Vm is set as default to -Xmx256M; without
setting it manually for each app.

thnx!
Kimbuba.


It depends on your virtual machine.

Note how this is problematic: The goal of Java is to 'write once, run
anywhere.' If you have to tweak the VM, you begin to defeat this
principle. If you need hundreds of megs available stack space,
perhaps you should rework your code, removing some recursion and using
a queue instead, thereby eliminitating a stack space dependency.

---
Jared Dykstra
http://www.bork.org/~jared
Jul 17 '05 #2
nos

"Jared Dykstra" <dy******@hotmail.com> wrote in message
news:ba**************************@posting.google.c om...
"kimbuba" <ki*************@yahoo.it> wrote in message

news:<vn*******************@tornado.fastwebnet.it> ...
Hello,
do you guys know how to increase the maximum heap for the jvm?
I know about giving to apps args like:
-Xmx<size> set maximum Java heap size

But i would like to give to my VM maximum heap defaults.
Any application that will use my Vm is set as default to -Xmx256M; without setting it manually for each app.

thnx!
Kimbuba.


It depends on your virtual machine.

Note how this is problematic: The goal of Java is to 'write once, run
anywhere.' If you have to tweak the VM, you begin to defeat this
principle. If you need hundreds of megs available stack space,
perhaps you should rework your code, removing some recursion and using
a queue instead, thereby eliminitating a stack space dependency.

---
Jared Dykstra
http://www.bork.org/~jared


or you could convert local variables to fields
then they would be on the heap and not on the stack
Jul 17 '05 #3
Note how this is problematic: The goal of Java is to 'write once, run
anywhere.' If you have to tweak the VM, you begin to defeat this
principle.


Ok wait!
I begin to understand.
You mean that if i tweak my VM to -> 256M and the app i use is build for 64M
vms the app will never go behind that?

I mean, if i'm using eclipse and i start eclipse with more than 64M there
will be no improvments?
Because if eclipse goes over 64m one day, it will goes on Out of memory for
all the other standard users on all the world?

I thought that java went on I/O swapping when no more memory is available.
What you are telling me is that if the java memory goes over the allowed it
will crash in any case?

Thnx
(do you have some resources on memory and java?)


Jul 17 '05 #4
"kimbuba" <ki*************@yahoo.it> wrote in message news:<HJ******************@tornado.fastwebnet.it>. ..
Note how this is problematic: The goal of Java is to 'write once, run
anywhere.' If you have to tweak the VM, you begin to defeat this
principle.


Ok wait!
I begin to understand.
You mean that if i tweak my VM to -> 256M and the app i use is build for 64M
vms the app will never go behind that?

I mean, if i'm using eclipse and i start eclipse with more than 64M there
will be no improvments?
Because if eclipse goes over 64m one day, it will goes on Out of memory for
all the other standard users on all the world?

I thought that java went on I/O swapping when no more memory is available.
What you are telling me is that if the java memory goes over the allowed it
will crash in any case?

Thnx
(do you have some resources on memory and java?)

The goal is to simply use the stack space effectively. Use it but
don't abuse it.

As for memory allocation, the VM asks the OS for RAM. The underlying
OS can then choose to use virtual memory or tell the VM no more memory
is available. It is system dependant. The Java VM will not use swap
space to create more memory--that is beyond the scope of a virtual
machine.

There is a book by o'reilly called "Java Virtual Machine" (ISBN:
1-56592-194-1) that provides an overview of the VM. It's several
years old now however. I'm sure better resources exist.

---
Jared Dykstra
http://www.bork.org/~jared
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Chris Morgan | last post by:
I'm trying to get php to run on my webserver as a Java Servlet, it works the first time but fails the second time and crashes the JVM with the following error: I have tried the latest versions...
0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
133
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
4
by: Christos Kalantzis | last post by:
Hello, I am trying to get JAVA UDFs working in DB2 8.2.2. I created a class, then I compiled it using with the IBM JDK included with DB2. I put the class in the sqllib folder and created a...
148
by: BillJosephson | last post by:
Want to do OOP. Does c++ have all the abilities of java, or is it some subset? Thanks...
2
by: thomasolsen | last post by:
Hi, I have a java program running on Linux Debian using jre 1.6 (I have tried under 1.5 with excatly the same results). As the program is running as a service I have been watching the memory usage...
350
by: Lloyd Bonafide | last post by:
I followed a link to James Kanze's web site in another thread and was surprised to read this comment by a link to a GC: "I can't imagine writing C++ without it" How many of you c.l.c++'ers use...
318
by: King Raz | last post by:
The shootout site has benchmarks comparing different languages. It includes C# Mono vs Java but not C# .NET vs Java. So I went through all the benchmark on the site ... ...
1
by: HxRLxY | last post by:
I have a program that shows a thumbnail of an image. If the user clicks on the thumbnail a new JFrame is opened that shows the full size image. If the image is larger than the screen, it gets...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
1
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.