#6 OutOfMemory risk with SessionStorage


Currently AFAIK, when you use the Session storage
Storage object, every time an image is generated,
it is stored in the session.
When the same client asks for the same chart at an
interval, 2 ChartImage will be stored in the session.
If you have a lot of client, the session will be
overwhelmed with unused objects that will only be
destroyed on timeout.

So I added an boolean option in the img
tag "removeAfterDisplay" (defaults to true)
which send this request parameter to the renderer
servlet so that the renderer decides wether he should
remove the Object from the Storage or not.
In order to do that, I added the method

public ChartImage removeChartImage(String cid,
HttpServletRequest request)
throws CewolfException;

in the Storage interface and implemented it in the

Philippe Mouawad


  • Philippe Mouawad


  • John Schwartzman

    Logged In: YES

    Does your solution care what storage method is used?

    I was using TransientSessionStorage and getting lots and lots
    of serialization errors - mainly when the webapp is shutting
    down. It was suggested that I change to
    de.laures.cewolf.storage.ClusterableSessionStorage, even
    though my application isn't clustered. This does seem to
    eliminate the problem.

    Do you have any experience with this?

  • Brian Fox

    Brian Fox - 2005-02-23
    • status: open --> closed

Log in to post a comment.