• Post Reply Bookmark Topic Watch Topic
  • New Topic

memory and layouts  RSS feed

 
Ian Browner
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm developing a gui in a unix environment and one of my concerns is the size of the JVM in terms of memory.
The guis will all reside on one machine and be displayed to remote terminals.
Each gui will have it's own JVM, so memory usage could get become a problem as the number of clients grows.
My question is - do differnt layout managers have a significant impact on memory usage?
Alternatively, could I instantiate all the guis on a single virtual machine, but still have them displayed on different remote terminals?
Thanks,
Ian.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No... layout managers should not be a big impact to memory.

One question though... why are you running all the GUIs on one machine? Why not just run the server on the main machine and have the other machines run their own clients in JVMs on their machine?
 
Ian Browner
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nate,
thanks for the reply.
Unfortunatley, the Java app I'm working on is part of a existing product (developed in C++).
Currently, the gui application resides on a single machine, and users log into this machine and launch the guis(see diagram below).
Obviousy when there are 10/11 instances of our gui running, each with a JVM size of roughly 20MB, memory becomes an issue.
Another solution would be to launch all the guis within a single JVM, but I don't know how to display the guis on differnt machines, or even if it can be done.
Thanks,
Ian.
----------------------
| |
| SERVER |
| |
| |
| |
| |
| |
----------------------
/|\
|
|
-------------------------------------------------
| GUI MACHINE |
| |
| ------------ ------------ ------------ |
| | gui | | gui | | gui | |
| | instance | | instance | | instance | |
| ------------ ------------ ------------ |
| /|\ /|\ /|\ |
------|-----------------|-----------------|-------
| | |
| | |
------------ ------------ ------------
| unix | | unix | | unix |
| terminal | | terminal | | terminal |
------------ ------------ ------------
 
Ian Browner
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...sorry for the double post - diagram may be improved in this one
Hi Nate,
thanks for the reply,
Unfortunatley, the Java app I'm working on is part of a existing product (developed in C++).
Currently, the gui application resides on a single machine, and users log into this machine and launch the guis(see diagram below).
Obviousy when there are 10/11 instances of our gui running, each with a JVM size of roughly 20MB, memory becomes an issue.
Another solution would be to launch all the guis within a single JVM, but I don't know how to display the guis on differnt machines, or even if it can be done.
Thanks,
Ian.


(edited by Nathan to enclose diagram in code tags)
[ November 26, 2003: Message edited by: Nathan Pruett ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you put code tags around diagrams they are a little more readable... but still not great...

Please expand on the statement "the Java app I'm working on is part of a existing product (developed in C++)"... is the C++ the part of the diagram that is labeled "Server" that is separate from the rest of the application? Is it tied in with each GUI process?

Could you describe each part of the diagram in more detail? Are the parts labelled 'Unix Terminal' in the diagram actual separate machines or are they just indications of multiple sessions logged into the 'GUI Machine'?

Why couldn't the design look like this?



Or like this?



These designs make more sense to me (and are more scalable) than trying to run all the GUIs on one machine and exporting the displays using X server.
[ November 26, 2003: Message edited by: Nathan Pruett ]
 
Ian Browner
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nate,
sorry for the delay...
I agree - your solutions are a lot more scalable, but the aplication I'm working on is part of an already established product whose architecture won't change any time soon.
Regarding the statement "the java app I'm working on is part of an existing product (developed in C++)"...the C++ application resides on the "SERVER" in my diagram, and the gui for this application resides on the "GUI MACHINE".
The "unix terminals" represent seperate machines (although they could also be multiple sessions) which log into this GUI MACHINE and start instances of the gui, which are displayed on the individual terminals.
My Java app will also reside on the SERVER, and it's gui on the GUI MACHINE. This is a constraint of the existing implementation, and is not the design I would have chosen...but I'm sure they had a good reason with the original product.
The problem is that each instance of the gui will require it's own JVM, which is a real problem memory wise (although at the moment we only have to support 12 clients).
Thanks for the help,
Ian.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you *have* to run your GUI on the 'GUI Machine' then there really isn't any way around it...

You may want to take a look at the java.awt.GraphicsEnvironment and GraphicsDevice classes and play around with them in your environment to see if you could use them to run one JVM that launches frames using the graphics contexts of each client. From using these before I think that you can only get local graphics devices, but I haven't tried setting a remote graphics context from them, so it *might* be possile.

If this doesn't work (I don't really have a lot of faith that it will, but have no way to test out currently) then you'll just have to launch each GUI in a separate JVM so each will go to the correct display.

I would still design it so that it would be easy to change to something like the second diagram, just in case you need to add more clients or there are bigger scalability problems.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!