For Programmers: Free Programming Magazines  


Home > Archive > Java Help > June 2007 > [Applet]heap space problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author [Applet]heap space problem
Daniel Moyne

2007-06-12, 4:18 am

I have an applet which is supposed to open a huge file (no problem to open a
small file !) ; this text file is 11,2 Mb ; when running the applet I
collect an error message saying : heap space problem

I know how to allocate more memory for a Java application (-Xmx512m -Xms32m
arguments) but with an applet how to achieve the same result ?

This question has been asked many times on the net but I have not seen a
clear answer so far.
Thanks
Jack Marsh

2007-06-12, 4:18 am

Daniel Moyne wrote:
> I have an applet which is supposed to open a huge file (no problem to open a
> small file !) ; this text file is 11,2 Mb ; when running the applet I
> collect an error message saying : heap space problem
>
> I know how to allocate more memory for a Java application (-Xmx512m -Xms32m
> arguments) but with an applet how to achieve the same result ?
>
> This question has been asked many times on the net but I have not seen a
> clear answer so far.
> Thanks

For Windows XP

Start->Control Panel->Java opens Java control panel
[Java]->Java Applet Runtime Settings->View

Product name | version | location | Java Runtime Parameters
-------------+----------+----------+------------------------
JRE | 1.6.0_01 |C:\Prog...| -Xmx512m -Xms32m goes here
------------------------------------------------------------
Andrew Thompson

2007-06-12, 4:18 am

Daniel Moyne wrote:
...
>I know how to allocate more memory for a Java application (-Xmx512m -Xms32m
>arguments) but with an applet how to achieve the same result ?


web start

>This question has been asked many times on the net but I have not seen a
>clear answer so far.


<http://www.physci.org/jws/#giffer> or more specifically
<http://www.physci.org/giffer/giffer0512.jnlp>

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via http://www.javakb.com

Daniel Moyne

2007-06-13, 8:10 am

Jack Marsh wrote:

> Daniel Moyne wrote:
> For Windows XP
>
> Start->Control Panel->Java opens Java control panel
> [Java]->Java Applet Runtime Settings->View
>
> Product name | version | location | Java Runtime Parameters
> -------------+----------+----------+------------------------
> JRE | 1.6.0_01 |C:\Prog...| -Xmx512m -Xms32m goes here
> ------------------------------------------------------------

Jack I am Linux !
daniel.
Daniel Moyne

2007-06-13, 8:10 am

Andrew Thompson wrote:

> Daniel Moyne wrote:
> ..
>
> web start
>
>
> <http://www.physci.org/jws/#giffer> or more specifically
> <http://www.physci.org/giffer/giffer0512.jnlp>
>

Andrew,
everybody knows the advantage of placing an Applet in a website ; in my case
you to substitute something in my website working with webstart ?
Daniel.
Gordon Beaton

2007-06-13, 8:10 am

On Wed, 13 Jun 2007 12:46:49 +0200, Daniel Moyne wrote:
> Jack Marsh wrote:
>
> Jack I am Linux !


The procedure is not significantly different on Linux.

Start the Java control panel, found in $JAVA_HOME/jre/bin. Click on
Java -> Java Applet Runtime Settings -> View, then add the arguments
exactly as shown above.

/gordon

--
Andrew Thompson

2007-06-13, 8:10 am

Daniel Moyne wrote:
>[quoted text clipped - 7 lines]
>
>Andrew,
>everybody knows the advantage of placing an Applet in a website ;


I don't know the advantage you refer to. Inform me.

>...in my case
>you to substitute something in my website working with webstart ?


Huhh?* The only things the web site needs to be able to
do in order to serve web start apps. are..
1) Provide the correct content type for JNLP files
(many servers are now correctly configured, and
for those that are not, it is usually a trivial change)
2) Serve up any files that are requested by the Java plug-in.

* ..but I do not follow that sentence.
1) Why did it use the word 'you'?
2) What do you mean by 'substitute'? A web start
launch requires one JNLP file, and it can replace the
'applet.html'.

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.as...-setup/200706/1

Daniel Moyne

2007-06-13, 7:26 pm

Gordon Beaton wrote:

> On Wed, 13 Jun 2007 12:46:49 +0200, Daniel Moyne wrote:
>
> The procedure is not significantly different on Linux.
>
> Start the Java control panel, found in $JAVA_HOME/jre/bin. Click on
> Java -> Java Applet Runtime Settings -> View, then add the arguments
> exactly as shown above.

Gordon,
ok but we are talking about an applet executed on th clients's computer ; is
this to be done on the server where the web page is located or on the
client where the applet is played ; in the latter case most of the people
viewing the web page wont't know waht to do ?
Regards.
Daniel Moyne

2007-06-13, 7:26 pm

Andrew Thompson wrote:

> Daniel Moyne wrote:
>
> I don't know the advantage you refer to. Inform me.
>
>
> Huhh?* The only things the web site needs to be able to
> do in order to serve web start apps. are..
> 1) Provide the correct content type for JNLP files
> (many servers are now correctly configured, and
> for those that are not, it is usually a trivial change)

ok that can be managed on the server
> 2) Serve up any files that are requested by the Java plug-in.
>
> * ..but I do not follow that sentence.
> 1) Why did it use the word 'you'?
> 2) What do you mean by 'substitute'?
> A web start
> launch requires one JNLP file, and it can replace the
> 'applet.html'.

ok you mean once properly installed it will be completely transparent for
the client viewing the web page assuming he has a JVM istalled like the one
used to play applets ?

I think I have to look at the webstart doc.
Daniel.

Gordon Beaton

2007-06-14, 4:21 am

On Wed, 13 Jun 2007 21:43:09 +0200, Daniel Moyne wrote:
> is this to be done on the server where the web page is located or on
> the client where the applet is played ; in the latter case most of
> the people viewing the web page wont't know waht to do?


This is done on the client computer. So you'll either have to tell
them what to do if they want to use the software, or use JWS as others
have suggested.

/gordon

--
Andrew Thompson

2007-06-14, 4:21 am

Daniel Moyne wrote:
(..but for applet?)
...[color=darkred]
>ok you mean once properly installed it will be completely transparent for
>the client viewing the web page


...hmmm. I would not necessarily go that far.
Some browsers running older Java's that do not
understand JNLP files will still try to display the
content of the XML file in the browser.

Sun has some scripts that are designed to detect
if the browser can properly handle JNLP, but I do not
like to assume that the browser will have Javascript
enabled. Note that I do not know of a single end user
who would allow Java but not Javascript, but I still do
not like to *assume* scripting is on. ..

>...assuming he has a JVM istalled like the one
>used to play applets ?


.. I am in the process of developing an alternate, applet
based launcher for JNLP's, but it requires a few more
clicks from the end user. (And will not be ready for a
while yet.)

>I think I have to look at the webstart doc.


That is a good move. An overview can be seen
in the Developer's Guide at..
<http://java.sun.com/j2se/1.5.0/docs...e/contents.html
>

(That document also goes into detail about the
Sun scripts for detecting web start.)

Though if you really get into it, the JNLP spec.
is invaluable - but is is only available for
download (something I find most inconvenient
when discussing such things on the net!).

The spec. can be obtained here..
<http://java.sun.com/products/javawe...nload-spec.html>

HTH

--
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.as...-setup/200706/1

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com