You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Giovanni <va...@gmail.com> on 2013/09/01 10:53:21 UTC

Re: "OutOfMemoryError: Java heap space" when i try to upload and show a hundred 100kb pics

Martin Grigorov-4 wrote
> Hi,
> Read about Java memory settings (-Xms, -Xmx)

Yes, I can increase heap space by settings, but is this a good approach? If
displaying one 10Mb pic consumes 1.5Gb heap space - is this normal? Maybe
there are other ways to solve this problem without increasing heap space by
settings?



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/OutOfMemoryError-Java-heap-space-when-i-try-to-upload-and-show-a-hundred-100kb-pics-tp4661159p4661161.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: "OutOfMemoryError: Java heap space" when i try to upload and show a hundred 100kb pics

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Try memory profiler to see what is at matter.

**
Martin


2013/9/1 Giovanni <va...@gmail.com>

> Martin Grigorov-4 wrote
> > Hi,
> > Read about Java memory settings (-Xms, -Xmx)
>
> Yes, I can increase heap space by settings, but is this a good approach? If
> displaying one 10Mb pic consumes 1.5Gb heap space - is this normal? Maybe
> there are other ways to solve this problem without increasing heap space by
> settings?
>
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/OutOfMemoryError-Java-heap-space-when-i-try-to-upload-and-show-a-hundred-100kb-pics-tp4661159p4661161.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: "OutOfMemoryError: Java heap space" when i try to upload and show a hundred 100kb pics

Posted by Michael Mosmann <mi...@mosmann.de>.
Am 01.09.13 10:53, schrieb Giovanni:
> Martin Grigorov-4 wrote
>> Hi,
>> Read about Java memory settings (-Xms, -Xmx)
> Yes, I can increase heap space by settings, but is this a good approach? If
> displaying one 10Mb pic consumes 1.5Gb heap space - is this normal? Maybe
> there are other ways to solve this problem without increasing heap space by
> settings?
I think there is a better solution if you do not have unlimited memory 
:). See http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/ 
. You generate every image in your page render loop. This way the image 
data is stored in your page (which is bad). If you use a 
DynamichImageResource the image is created when the image request comes 
in. But you have to store your images somewhere else (remove this static 
list of buffered images) and refer to them with an ID.

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org