473,769 Members | 5,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 11743
"kimbuba" <ki************ *@yahoo.it> wrote in message news:<vn******* ************@to rnado.fastwebne t.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******@hotma il.com> wrote in message
news:ba******** *************** ***@posting.goo gle.com...
"kimbuba" <ki************ *@yahoo.it> wrote in message

news:<vn******* ************@to rnado.fastwebne t.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******* ***********@tor nado.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
3478
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 of PHP 4. (release and dev) I would appreciate any help with this issue. -- Chris
0
6814
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 the issue is. Thanks Ravi
133
8595
by: Gaurav | last post by:
http://www.sys-con.com/story/print.cfm?storyid=45250 Any comments? Thanks Gaurav
4
3712
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 function that references the class and the function within that class. When I run it, this is the message I get.
148
5211
by: BillJosephson | last post by:
Want to do OOP. Does c++ have all the abilities of java, or is it some subset? Thanks...
2
4186
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 from within linux, as well as using JProfiler. When looking at it from the operating system using ps or top I can see that the is a small increase in memory consumption every hour and never decreases again (like a memory leak). So I looked at...
350
11876
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 one, and in what percentage of your projects is one used? I have never used one in personal or professional C++ programming. Am I a holdover to days gone by?
318
11118
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 ... http://kingrazi.blogspot.com/2008/05/shootout-c-net-vs-java-benchmarks.html Just to keep the post on topic for my friends at comp.lang.c++, how do I play default windows sounds with C++?
1
7141
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 scaled to the the size of the screen. Functionally, the program works well. However, when testing I found that after clicking the thumbnails of several images (and subsequently closing their viewing frames), I get an java.lang.OutOfMemoryError: Java...
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.