Applet heap size

I’m doing a port of some Flash code to an applet, but stumbled upon a little problem: the heap size of an applet. Some surfing suggested that the heap size for applets are a static size and it can be changed with each user speficying the size in their control panel. Is this right (in which case the responsible ought to be shot! :slight_smile: )

Are there any work-around for this (like a signed applet etc.)? My entire interface relies on the webbrowser.

The default heap size is 64mb… if that’s not enough for an applet you might be doing something wrong! Do you need more than that?

Cas :slight_smile:

I need ALOT more. I’m doing image processing and my current implemention in Flash can use up to a gigabyte or more of memory. Who the hell thought 64mb of memory should be enough (640K is Enough For Anyone)!!! :slight_smile: I’d actually like to stay in Flash, but the JavaVM allows for so much more so it’s a bit fustrating walking into the Applet world.

in 1.6 update10 you can define the heap via tags, no need for signing:

<PARAM name="java_arguments" value="-Xmx500m">

But this won’t work with versions below.

[quote]Who the hell thought 64mb of memory should be enough (640K is Enough For Anyone)
[/quote]
yes! and I guess about 90% of all users won’t care about /recognize it if the applet needed 64 or 640mb.

I just discovered this too and been able to push memory up to atleast 800mb. Needless to say, ranting mode off. :slight_smile:

Wonder if JavaFX pushed this into the update (or maybe I should say, Adobe pushing into the Application domain)?

to make the story short except in 1.6 update 10 there is no way to increase the JVM memory setting at runtime, and even a signed applet wont works. I found that the default heap size may vary depending on target JVM and maybe OS not sure.

one workaround could be to use streaming and allocate object only when they are requiered rather than allocating all objects when starting.

I atleast have no problem with requiring 1.6 update 10 and fallback on Flash with limited functionality.

In theory, you can launch a separate java VM in your signed applet, and make both VMs map the same file (MappedByteBuffer). Now you can transfer data between the two VMs at full speed (capped by memory bandwidth).

Works in 1.4.2+ as opposed to 1.6.0_u10+

[quote]In theory, you can launch a separate java VM in your signed applet, and make both VMs map the same file (MappedByteBuffer). Now you can transfer data between the two VMs at full speed (capped by memory bandwidth).

Works in 1.4.2+ as opposed to 1.6.0_u10+
[/quote]
you mean lauching a new java instance ? like executing :

java -Xmx512m mydownloadedjar

Yes, you can have interprocess memory I/O with mapped bytebuffers.