File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes not enough session space Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "not enough session space" Watch "not enough session space" New topic

not enough session space

Mike Ev

Joined: May 17, 2007
Posts: 11

I have a jsp page to upload some files..

The session is used to store a Map ( session.setAttribute("filemap", filemap ) ). This map contains all the files to be uploaded. I have a file-input type, onChange the file here is added to the map. The map is stored in the session and when the page is reloaded, all files in the map can be displayed. Then the user clicks upload, and all the files are uploaded somewhere by some other code.

This works perfectly on my local machine/local host -- on the server however, i've encountered this problem...
When I browse for a file to upload and select it (with the file-input) and the page reloads - files of small file-size will work fine. The page will re-load, the item will be added to the map and displayed on the page. When I select a file with a larger file-size (even 200KB), the page shows a 'page not found' error when it reloads. I'm guessing the session on the server cant hold much space!

Does anyone know how I can get around this? Any help is appreciated!

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

There is no such thing as "session space". Your server is likely bumping up against a general out-o-memory constraint. Do you really feel that holding large files in memory is a scalable and sustainable design?
[ June 07, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
Mike Ev

Joined: May 17, 2007
Posts: 11
its only a small internal program and will only be dealing with 'small' files. Any suggestions on an alternative way round this?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
the page shows a 'page not found' error when it reloads.

At this point most people would have gone to the log files to find out the exact cause rather than speculating about "session space."

Exactly how are you holding the file data? Does the server actually write a file? Where?

I agree. Here's the link:
subject: not enough session space
It's not a secret anymore!