473,383 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 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 11727
"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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.