Solved

Is there still a limit on the size of Tomcat session object?

Posted on 2011-03-18
8
1,004 Views
Last Modified: 2012-06-22
I am running servlets on very old version of Tomcat (3.3) on Solaris 8 server.
It worked well for me for many years.
Now I encountered the situation when one of my session objects which I use to pass stuff from one
servlet  to the next one happened to be unusually big (nothing dramatic - I guess all of it is in megabytes
and maybe just a few megabytes - no comparison with about 1 GB memory I allocate to running Tomcat; I don't have many users/sessions either). What happens - with this big session size the second page cannot get hold of session object - it returns null,
as if there would not be any session before or as if  session expired (in fact it cannort expire, as I do it very quickly).
Strange thing is that this is definitely session object size related. If I use the same servlet but read in a little bit less data - then it passes
session information to the next page without any problem. Everywhere it is written that Tomcat does not
have limit on individual session size, but it looks like that this is what I observe.
Did anyone see similar things with Tomcat (perhaps with the old one)?.
Is there a way to influence it? I already increased -Xmx on Tomcat start to 1300m from 700m I used
before this situation, but it didn't help.
0
Comment
Question by:for_yan
  • 3
  • 3
8 Comments
 
LVL 92

Expert Comment

by:objects
Comment Utility
why do you think the size of the session is causing it to return null?
0
 
LVL 47

Author Comment

by:for_yan
Comment Utility
This servlet collects some number of records - allows the user to do something with them
and then passes on to the next servlet which stores the records back to the DB.
Alll these years I had a few dozens records and all worked fine.
Now it happnes that they have more than a hundred records (never happened before) and
when I try to get the session object in the second servlet it returns null to me.
If i modify parametsers of the first servlet, so that it reads in say about 90 records, then
everything works fine and normal session object is returned.

I have several applications runnsing in more or less similar way (but with smaller session objects)
on the same Tomcat and all other applications run without problems.
My first thought was that I didn't restart Tomcat for many months and something
got wrong. But now i restarted it several times, increased the heap
and still observe the same situation.
All these servlets worked in the same way for long time, were not
changed recently - and the only thing different today, is that we have
unnaturally long list of records to process.

All these records are by no means comaparable to any gigabytes, i don't
thing all these recirds together woyld even take a meg

   
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
test it on a recent version of tomcat to see if you get the same behaviour
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 47

Author Comment

by:for_yan
Comment Utility
I do have a backup system with Tomcat 6.0 and it does work on that system.
But frankly I'm reluctant to move the whole operation there as I have everything much better
tested and used on the old one, and although I was trying to keep it all in sync on the newer
version, I can not be quite sure of it.

Now that I realized, that it is size related, I do have a fallback strategy (even before I start seriously thinking of moving all my stuff to Tomcat 6)
 to teach the users (I don't have a hundred of them - just 2-3 people), in such case, when they accumulated
so many records, which happens extremely rarely, - to do it stepwise and read in at first less
 records and then close some of them, after which
it should operate as before, as the total number of records will become less than 100.
Still, if I find the way to overcome it in a way transparent to users, that would be very nice.

0
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
Comment Utility
that would suggest its a bug in tomcat 3.3 so not a lot you can do (besides limiting what is stored in the session)
0
 
LVL 47

Author Comment

by:for_yan
Comment Utility
Yes, unfortunately that is probably what I'll have to do.
 Thanks.
0
 
LVL 59

Expert Comment

by:Kevin Cross
Comment Utility
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Most of the developers using Tomcat find it easy to configure the datasource in Server.xml and use the JNDI name in the code to get the connection.  So the default connection pool using DBCP (or any other framework) is made available and the life go…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now