aspose file tools*
The moose likes Performance and the fly likes Overhead of Java items? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Overhead of Java items?" Watch "Overhead of Java items?" New topic
Author

Overhead of Java items?

Jay Orsaw
Ranch Hand

Joined: Jun 14, 2011
Posts: 354

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
Rancher

Joined: Sep 21, 2011
Posts: 2408
Define "overhead". It's not a term that has a single generally recognized meaning in this context.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

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."


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18114
    
    8

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

Joined: Aug 11, 2007
Posts: 4634
    
    5

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

Joined: Jun 14, 2011
Posts: 354

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

Joined: Jan 10, 2002
Posts: 60046
    
  65

Lilian Chase,
Your post was moved to a new topic.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Overhead of Java items?
 
Similar Threads
Registry key error
Having problem with JQ+
Performance 1.2 to 1.3
Custom tags
Using libraries in an older java version