Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Memory optmization in Swing  RSS feed

 
Nagarajan Krishnamurthy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am currently working in a project in which Server intiates the Clients application[Swing] and keeps track of the application.For a single client it consumes some 20MB memory.For more than 200 client it consumes 20Mb*200 & More memory .Is there any way by which i can optimize the memory consumption in Java?.

Note : I tried calling the swing from a JSP.But even that failed.

Any body has the answer ?
 
Petr Blahos
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nagarajan,

That's very easy. The less you tell us, the less of an answer you can expect.

Is the client written with Swing or the server? The data server keeps about clients: are they somehow related to swing? Or do clients run on the same computer as servers? I somehow fail to see relationship between your server, your clients, swing and memory consumption.

You can't call swing from JSP because it is java SERVER pages and you scaresly have a monitor connected to a server. If you want to see a swing application in client's web server, you will have to write an applet (or a client application). I think there is an example of an applet in Tomcat.

Best regards,
Petr
 
Nagarajan Krishnamurthy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Actually it is a desktop application develped in Swing and it runs in server.Each user access this swing application thro X-Manager.So for each user it occupies appx 20Mb memory so for 200 and more users it occupies more memory .



Regards
Nagz



Originally posted by Petr Blahos:
Hi Nagarajan,

That's very easy. The less you tell us, the less of an answer you can expect.

Is the client written with Swing or the server? The data server keeps about clients: are they somehow related to swing? Or do clients run on the same computer as servers? I somehow fail to see relationship between your server, your clients, swing and memory consumption.

You can't call swing from JSP because it is java SERVER pages and you scaresly have a monitor connected to a server. If you want to see a swing application in client's web server, you will have to write an applet (or a client application). I think there is an example of an applet in Tomcat.

Best regards,
Petr
 
Petr Blahos
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My estimation would be that you don't have much chance here. Even if you reduced the amount of memory needed to 1/2, which is 10M per process, still, 200 times, it is, like, well, a lot. Considering also overhead with managing so many processes, I would say that the system will become unresponsive long before 200 users log in.

If the clients are capable of running java, run it on clients, otherwise, it pretty much depends on the type of the application.

P.
 
Nagarajan Krishnamurthy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter,
Unfortunately all my clients are dump terminals.So i cant run the appn in the client side.Is there any other technology by which i can do this one .

Eagerly waiting for your reply : )


Regards
Nagz
 
Petr Blahos
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just out of curiosity, what HW and OS is the server? S390?

If you could run at least a web-client of the clients, you could have a web application. It is something different to handle 200 network connections than 200 processes.

Best of luck,
Petr
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a very unusual application architecture! Much more common would be (as you suggest) a JSP interface to a web-based application, which will use far less memory per client. Now, you may have to sacrifice some richness of the interface -- but that's a tradeoff that most people are willing to make.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!