Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Memory savings with Java 5 and eclipse?  (Read 1669 times)
0 Members and 1 Guest are viewing this topic.
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Posted 2004-10-14 15:10:41 »

Eclipse is a memory hog, especially considering it runs an *entirely separate process* per workspace. So much so that my poor crappy laptop runs out of RAM if I have two or three workspaces open and try to also check email and surf sites (needed whilst developing!).

Because linux swapping is so utterly utterly crap after a few days I have to reboot the computer to clear out the swap etc if I run like this - else I end up with literally 5-minute waits moving from one workspace to the other (alt-tab) or to my web-browser etc.

BUT...java 5 supposedly has some of the shared-class stuff. So, I'm wondering if this makes any considerable saving with multiple workspaces for eclipse, or whether the saving is negligible...anyone tried it?

For reference, a typical workspace for me takes up 95Mb of RAM (according to linux). By only ever working on a few files at once (the pain!), combined with the fact that it eventually swaps some of that out because I'm not using it, I can steam along OK at around 87Mb usage per workspace. Still, three workspaces blows my entire RAM, and two struggle to co-exist with Mozilla (which has many memory leaks).

malloc will be first against the wall when the revolution comes...
Offline Evil-Devil

Senior Member


Medals: 2


Fir Tree Master


« Reply #1 - Posted 2004-10-15 09:52:25 »

I mention that the current Eclipse versions don't use any Java 1.5 performance boosts. Maybe the 3.0.2 release will change that.
90MB is also the typical workspace size on windows. I hope that it will run smoother when i got the addiditional 512MB Ram next week Smiley
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #2 - Posted 2004-10-15 13:12:56 »

If I may be so bold, I think that if you're running Eclipse on three different workspaces at once, you may have misinterpreted what the word "workspace" implies! Grin

I don't think Eclipse has to do anything special to take advantage of class-definition sharing - it "just happens".  So I, too, would be interested to hear whether it works in the real world, and whether the engineers were right to spend so much time on it!  Anyone?

Hellomynameis Charlie Dobbie.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #3 - Posted 2004-10-15 13:41:56 »

Quote
If I may be so bold, I think that if you're running Eclipse on three different workspaces at once, you may have misinterpreted what the word "workspace" implies! Grin


Interesting point, but no - I'm forced to do this because that's the way that Eclipse wants you to do it. Eclipse wants to do various things on "all projects in the workspace" by default, and after trying to fight in (with only partial success) eventually I twigged why: An eclipse-workspace is what most people used to working on large projects would call a project (i.e. "one or more tightly related libraries", or "all the components of a large componentized application") and that an eclipse-project is what most people would call a single component (i.e. something that they JAR into just one JAR) - e.g. "a single self-contained library".

Now, I have:

1  a base engine project ( 8 JAR's) == one workspace
2  a CMS project (4 JAR's, runs on top of base engine) == another workspace
3  JGF server (1 JAR + N other JARs to add extra content/features later on) == a third workspace

The annoying thing is that I only very occasionally even need to even look at workspace 1 (usually to tweak some code that the CMS project is exercising in new ways, or to refactor something between the CMS and the base engine).

Whilst doing JGFv3, I often need to edit the CMS project (because this project is being brought to production-quality roughly in parallel with JGFv3).

But if I put all in one workspace I get the following problems:
- workspace has far far too many eclipse-projects in it to be manageable. Far too many open files at once for the navigation to be easy
- every time you change a base file, it reparses EVERYTHING, and you can end up waiting a long time for the reparse to chain through all those dozens of projects
- ...which is stupid, because the three workspaces are INDEPENDENT projects (in the real world sense) that just happen to link together at runtime.

But, thankfully, by having multiple workspaces I can insulate the various projects from each other.

malloc will be first against the wall when the revolution comes...
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #4 - Posted 2004-10-15 13:47:55 »

Quote

I don't think Eclipse has to do anything special to take advantage of class-definition sharing - it "just happens".  So I, too, would be interested to hear whether it works in the real world, and whether the engineers were right to spend so much time on it!  Anyone?


Yeah, it Just Works. But...the question is: how much saving is there? My suspicion is that you get hit by a mega-nasty side-effect of SWT: because it's not AWT, it's not involved in the class-sharing, so the savings are minimal. But... I can't quite recall how far the java 5 sharing goes - whether it was just core stuff or the whole of rt.jar etc.

So...looking for some experimental results! (And I don't have a spare PC which I can afford to risk putting java 5 on to check for myself Sad).

malloc will be first against the wall when the revolution comes...
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #5 - Posted 2004-10-15 14:46:53 »

Quote
But if I put all in one workspace I get the following problems:
- workspace has far far too many eclipse-projects in it to be manageable. Far too many open files at once for the navigation to be easy
- every time you change a base file, it reparses EVERYTHING, and you can end up waiting a long time for the reparse to chain through all those dozens of projects
- ...which is stupid, because the three workspaces are INDEPENDENT projects (in the real world sense) that just happen to link together at runtime.


Interesting.  Do you happen to have played with Working Sets?  They allow you to defines collections of things that you're interested in at one time, and may solve part one.  (Click the down arrow in the top-right of Package Explorer.)  The annoying bit is that the package explorer view will appear collapsed as opposed to how you left it.

Closed projects should be insulated from changes in a dependent project, so that should help with part two. (Right click project, select Close Project.)  You can even open or close several projects at once.

Also, if you define dependencies in terms of exported JAR files instead of inter-project dependencies, Eclipse won't need to rebuild everything until you update the current "exported" API.

Part three isn't really a separate point, so instead I'll use this paragraph to mention that if you're using different Workspace-global settings, you may be scuppered anyway. Grin

Hellomynameis Charlie Dobbie.
Offline cfmdobbie

Senior Member


Medals: 1


Who, me?


« Reply #6 - Posted 2004-10-15 14:49:00 »

Quote
So...looking for some experimental results! (And I don't have a spare PC which I can afford to risk putting java 5 on to check for myself Sad).


I'll see if I can do something tonight - although time, as ever, is short.


Edit: Regrettably, WinXP doesn't seem to come with any useful memory profiling tools - at all.  From the information that Task Manager is feeding me, it looks like every successive JVM instance takes up more RAM than the previous one... Roll Eyes

Hellomynameis Charlie Dobbie.
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #7 - Posted 2004-10-17 12:54:32 »

Quote
Eclipse is a memory hog, especially considering it runs an *entirely separate process* per workspace. So much so that my poor crappy laptop runs out of RAM if I have two or three workspaces open and try to also check email and surf sites (needed whilst developing!).


Followup: Perhaps SWT has been coded to share memory anyway (would make sense, given that it's a native code solution, not java)?

I'm not very good at manipulating "top", but managed to get the process info displayed for several workspaces at once, and noticed that:

 1. the first started workspace has approx 90Mb / 8Mb / 50Mb
 2. the next one has approx 110Mb / 42Mb / 110Mb

(where x/y/z = "amount of memory process is using" / "amount of memeory process  MIGHT be sharing with other processes" / "amount of ACTUAL, non-shared, memory process is exclusively using")

Top has quite a few problems with this stuff - it's ability to tell what is shared and what isn't is known to be often wildly inaccurate - but it would seem to suggest that the second workspace is sharing considerably amounts of memory with the first one?

Then again, the fact that it is claiming to be exclusively using 100% of its memory makes it all a bit uncertain Wink.

NB: switching to mozilla to post this reply caused HUGE swapping. When that was over, the second workspace was now: 92Mb / 22Mb / 86Mb. Eclipse has a tendency to ballon and deflate it's memory usage a LOT (probably generates lots of garbage?).

malloc will be first against the wall when the revolution comes...
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (17 views)
2014-08-28 18:26:30

CopyableCougar4 (26 views)
2014-08-22 19:31:30

atombrot (39 views)
2014-08-19 09:29:53

Tekkerue (36 views)
2014-08-16 06:45:27

Tekkerue (33 views)
2014-08-16 06:22:17

Tekkerue (22 views)
2014-08-16 06:20:21

Tekkerue (33 views)
2014-08-16 06:12:11

Rayexar (67 views)
2014-08-11 02:49:23

BurntPizza (45 views)
2014-08-09 21:09:32

BurntPizza (36 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!