Skip to main content

Specifying large heap sizes?

7 replies [Last post]
kraik
Offline
Joined: 2007-12-17

Hi,

Reading the various tidbits related to the new plugin seems to suggest that there will be an ability to specify large heap sizes through the java control panel.

Is there / or will there be a way to do this during the deployment of an applet? (e.g. -Xmx512 through html parameters).

For a conceptual application, an applet model is currently being considered primarily motivated by the re-architecture of the plug-in. However, from a usability standpoint we'd rather not have consumers specify app memory requirements themselves.

Regards,
Rob

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ferraribob
Offline
Joined: 2008-01-10

Will this parameter also work when an applet is specified using the Object tag?

kbr
Offline
Joined: 2003-06-16

Yes. It works identically with the applet, object and embed tags.

linuxhippy
Offline
Joined: 2004-01-07

I remember that some years ago browsers were blamed for allocating a lot of memory for very large images - which could bring the system completly down.

I wonder if the same could be done with the new Java-Plugin, imagine what would happen if my page would consist of many applets with large -Xmx values? Maybe it would not be a bad idea to limit that somehow?

By the way what will happen if one applet1, started before, does request -Xmx25m and applet2 started after it requests -Xmx1024m - will applet2 receive a new JVM or will the heap-settings be adjusted?

Thank you in advance, lg Clemens

kbr
Offline
Joined: 2003-06-16

We do not yet have limits in place for the number of JVMs that can be simultaneously attached, but will probably add some before FCS. I hate to artificially limit the software because of some people who have nothing better to do than try to break others' machines.

In your scenario a new JVM will be started for applet2. It is not currently possible to adjust the heap size of the Java HotSpot VM at run time. On the other hand, if applet2 was started first and applet1 started later, it would currently reuse the same JVM since 1024m > 25m. We have deliberately left the JVM instance sharing algorithm unspecified in the face of command line arguments being specified, but it's approximately that a JVM instance will be reused for a new applet if the JVM instance's command-line arguments are a superset of those requested by the applet, and if the requested max heap size is greater than or equal to that requested by the applet.

kbr
Offline
Joined: 2003-06-16

With the new plug-in you can actually do this on a per-applet basis directly in your HTML.

We still have to document this publicly but internally it looks like there is no opposition to disseminating the information, so here's a hint:

kraik
Offline
Joined: 2007-12-17

Ken, many thanks for clarifying that...

I understand that demanding more heap would also require the code to be trusted and signed too, is that right?

wbr,
Rob

kbr
Offline
Joined: 2003-06-16

No. Unsigned code can request a larger heap size or in fact specify any of the secure JVM arguments documented in the Java Web Start developer's guide.