Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Overhead of Java items?

 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just curious if there is a resource for what the overhead of various java objects/components etc... I found somethings that show the primitives, arrays, and objects, but I was curious about overhead of beans and swing stuff...

That brings me to my next question if I have an object with a lot of properties, and will have hundreds of not thousands of them displayed on a screen is it worth it to make a bean out of it, or would the performance drop from overhead?


I found this, http://java.sun.com/docs/books/performance/1st_edition/html/JPRAMFootprint.fm.html#24456 , but lets face it, we deff aren't going to take those value of Java 1.2 and 1.3 from 2001, especially because of the ridiculous drop of overhead from 1.2 to 1.3(Wow...). The objects I believe are still 8, but not sure about the rest.... Not a bad link overall though.
Thanks,

~JO
 
Tim Moores
Bartender
Posts: 2686
36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Define "overhead". It's not a term that has a single generally recognized meaning in this context.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34095
337
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jay,
In practice the overhead/performance from those low level things are rarely the bottleneck in a real application. It is better to start with a good design (create your bean) and then see where any actual performance issues are. I feel very confident that if there is any performance problem, it comes from having 1000 items on the screen rather than whether those 1000 items are in a bean or "loose."
 
Paul Clapham
Sheriff
Pie
Posts: 20758
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jay Orsaw wrote:but lets face it, we deff aren't going to take those value of Java 1.2 and 1.3 from 2001, especially because of the ridiculous drop of overhead from 1.2 to 1.3(Wow...).


The other reason to discount that document is that it's over 10 years old now. It's talking about a world which no longer exists -- a lot of changes have happened since then.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Google Guava team has a document that shows the size of various Java values, int, Integer, etc. along with arrays, lists, maps, sets, etc.
Don't have a direct link handy, but I was looking at it last night.
 
Jay Orsaw
Ranch Hand
Posts: 356
Android Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Jay,
In practice the overhead/performance from those low level things are rarely the bottleneck in a real application. It is better to start with a good design (create your bean) and then see where any actual performance issues are. I feel very confident that if there is any performance problem, it comes from having 1000 items on the screen rather than whether those 1000 items are in a bean or "loose."


Thanks! Someone who is an oldschool coder thinks that for every little thing we add there will be an overhead increase like crazy. I can deff understand that you want everything to be as fast as possible, but sometimes you need to use certain things. Especially in a time where computers are so fast anyways, that unless your program is leaking to the point it shuts down your computer then I wouldn't worry :P. Games like Heroes of Newerth that use 1.5gigs of Ram and freeze/crash all the time are what I am referring too as well. You can physically see the problems, but unless you see it like you said, you shouldn't have to worry about it...


Paul Clapham wrote:
Jay Orsaw wrote:but lets face it, we deff aren't going to take those value of Java 1.2 and 1.3 from 2001, especially because of the ridiculous drop of overhead from 1.2 to 1.3(Wow...).


The other reason to discount that document is that it's over 10 years old now. It's talking about a world which no longer exists -- a lot of changes have happened since then.


Yes that of course too, our world is ever evolving!













http://code.google.com/p/memory-measurer/wiki/ElementCostInDataStructures This is what I found, lots of stuff that makes no sense .
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lilian Chase,
Your post was moved to a new topic.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic