|
Replies:
5
-
Last Post:
Sep 22, 2005 2:20 AM
by: nullpointer
|
|
|
|
|
|
|
Setting the Java heap memory in the Java Control Panel
Posted:
Aug 31, 2005 2:00 AM
|
|
|
Dear all,
I am currently working on a java component which is used by a VisualBasic application. The way to do this is the ActiveX bridge provided by the Java Plugin - which works kind of.
However, as the java component does some heavy-duty calculation it needs quite some amount of memory, sometimes in excess of 256 MB. So, I tried to set "-Xmx500m" in the runtime parameter section of the Java Control Panel. After that the application can't load Java any longer. There are numerous reports on the net with respect to this. 256 MB seems to be the most that you can get. If anyone is willing to fix this I would be most grateful.
There is a worse problem though: When the memory settings are "-Xmx256m", java loads but the Java Console does not show any text printed to it. Instead the scrollbars are a bit fuzzy - as if the text was somehow printed on them? However, if you press Ctrl+A followed by Ctrl+C you can copy all the text (that you can't see) from the Java Console.
Could anyone please, please fix this?
Cheers, Snowbird
I am not sure if I made myself clear: The Java Control Panel is completely unusable on Windows XP with heap memory configured at 256m - but that's the least problem. The bigger problem is that you just can't get enough memory.
|
|
|
|
|
|
|
Re: Setting the Java heap memory in the Java Control Panel
Posted:
Aug 31, 2005 4:45 AM
in response to: snowbird0
|
|
|
Dear Snowbird,
What java/jre version are you using and on what operating system? I have done this in 1.3 - 5.0 many times.
If -Xmx is failing, then you don't have enough RAM available to satisfy the request. Make sure your page file is large enough to accomodate the requested size.
I agree that the dialog malfunctioning is nasty.
If I set -Xmx that high, I would also set the max new & perm sizes as well.
|
|
|
|
|
|
|
|
Re: Setting the Java heap memory in the Java Control Panel
Posted:
Aug 31, 2005 12:53 PM
in response to: texas_mustang
|
|
|
The operating system was NT 4.0 SP6 but is now WinXP Professional and I use Java 1.5.0 or the latest Mustang snapshot. As I have 1 GB of RAM allocating say 300 MB for the JVM should work I think. What's suspicious is hat 256M work but everything more than that does not.
What do you mean with max new & perm sizes? What kind of arguments do you suggest?
Cheers, Snowbird
|
|
|
|
|
|
|
|
Re: Setting the Java heap memory in the Java Control Panel
Posted:
Sep 6, 2005 6:00 AM
in response to: snowbird0
|
|
|
Does this same behavior occur even after increasing the page file size in windows XP? I havent been able to reproduce this problem locally, Is there any testcase that could duplicate the problem.
Also do post the settings from javaplugin.vm.options that are obtained from the java console (It will be part of the text that you can copy from the java console).
|
|
|
|
|
|
|
|
Re: Setting the Java heap memory in the Java Control Panel
Posted:
Aug 31, 2005 8:10 AM
in response to: snowbird0
|
|
|
I presume the ActiveX bridge results in a JVM being created within the VisualBasic process. I wonder how much contiguous address space is left? The current JVM implementation requires contiguous memory, so even if you have 1.5GB left in total, the maximum heap you can create may be significantly less.
|
|
|
|
|
|
|
|
Re: Setting the Java heap memory in the Java Control Panel
Posted:
Sep 22, 2005 2:20 AM
in response to: snowbird0
|
|
|
Hola!
1. You should not set -XmxNNN parameter en Java Control Panel (I think You set it in jvm execution line)
2. Instead of it You must find a file "\Documents and Settings\Your_User_Name\Application Data\Sun\Java\Deployment\deployment.properties" and add your parameter to line deployment.javapi.jre.1.5.0_04.args=-Xmx512m
3. Take care!!! After the first installation of JRE in a virgin computer this file will not be present, it will be created only after the first invocation of Java Plugin. (forget to set java parameters automatically from the installation program!)
4. You shouldn't use JRE shiped with your plugin, in this case plugin will not have any permissions and will work like an applet.
5. Shure that You will have problems with type marshalling from java to COM (like how to pass byte[] array). It is not sufficiently documented.
6. ActiveX bridges are incompartible for different versions of JRE.
7. Sun Java ActiveX bridge es una mierda!
Anton
|
|
|
|
|