This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Memory optmization in Swing

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ?
 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic