Tomcat 5

Hi All.

I'm using Tomcat5

I've a class like this :

-

public class User_Books

{

private String USER_ID;

private String Xxx;

....

void Add_Book( String book_id);

void RemoveBook(String book_id);

void ActionXxx();

....

}

-

Every time user enter the site ... I'm creating instance of this class and

store it in a session.

-

User_Books usr_books = new User_Books();

session.SetAttribute("User_Class",usr_books);

-

But we have 400.000 online user's . And the performance is slow.

-

What if I set all methods "STATIC" ? I heard that static methods loads into memory once.

Any idea ?

Thanks for response.

[761 byte] By [USSRa] at [2007-10-3 0:53:56]
# 1

If you use a static object, this object exists only one time in memory, but then you can't store user_books so many times. Instead you have to a Collection of user_books! And then the problem is the same.

If you has 400000 Sessions you should have a good server(s) and then the server has some Gigs of Memory and then this is no problem :-)

Or you can try to store the user_books in a database instead use the sessionstore!

regard Dietmar

didisofta at 2007-7-14 17:49:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
In my opinion you should think about setting up multiple servers to handle that app if the load is indeed that heavy.
gimbal2a at 2007-7-14 17:49:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Thanx for all , for response.

But owner of the site is a little mean:)))

--

I've a little different approach .

Any idea ?

-

public class User_class

{

String USER_ID;

String Xxx;

...

}

-

public class User_Book_Action

{

static void AddBook( User_class,String book_id);

static void RemoveBook( User_class,String book_id);

}

-

I'll store just User_class in a session and just use USer_Book_Action class as a action maker.

Any idea ?

Thanx

USSRa at 2007-7-14 17:49:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
First: what is an action makerSecond: Do you understand the meaning from static?regards Dietmar
didisofta at 2007-7-14 17:49:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
what is the JVM max and min heap memory you have set ? and how fast is this getting used when in peak load?you can give a try inby creasing the max heap memory and check
karka at 2007-7-14 17:49:11 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...