Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / March 2006

Tip: Looking for answers? Try searching our database.

About memory allocation

Thread view: 
odwrotnie - 03 Mar 2006 11:42 GMT
I am wondering if an object is bigger if it has a lot of methods.
If You dont know mayby You can tell me where can I find informations about  
memory allocation process?

Signature

Best regards,
Odwrotnie.

Green - 03 Mar 2006 14:29 GMT
Memory is typically divided into 3 parts:

1. Code segment (your code goes here)
2. Heap/Data (objects live here)
3. Stack (threads live here)

So if your objects has lots of methods it affects only the code segment
and not your heap. But if your object has lots of member variables then
your objects will be bigger and hence your heap will be affected.
Roedy Green - 03 Mar 2006 15:15 GMT
>I am wondering if an object is bigger if it has a lot of methods.
>If You dont know mayby You can tell me where can I find informations about  
>memory allocation process?

no the object size depends on the fields it has, not the methods.  The
object has a pointer to a vtbl which points to the code for the
methods so there in no extra per-method overhead on the object itself.

You can get the source for the JVM and have a look.

see http://mindprod.com/jgloss/jdk.html for the link. You have to sign
some sort of agreement first.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Roedy Green - 03 Mar 2006 15:16 GMT
On Fri, 03 Mar 2006 15:15:16 GMT, Roedy Green
<my_email_is_posted_on_my_website@munged.invalid> wrote, quoted or
indirectly quoted someone who said :

>You can get the source for the JVM and have a look.
>
>see http://mindprod.com/jgloss/jdk.html for the link. You have to sign
>some sort of agreement first.

I have never done this myself, though I would love to peek. The reason
is, once you do, you are no longer legally permitted to work on
alternate JVMs.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Tony Morris - 04 Mar 2006 01:11 GMT
> On Fri, 03 Mar 2006 15:15:16 GMT, Roedy Green
> <my_email_is_posted_on_my_website@munged.invalid> wrote, quoted or
[quoted text clipped - 8 lines]
> is, once you do, you are no longer legally permitted to work on
> alternate JVMs.

You are permitted to work on alternate JVMs, only there are various
restrictions under a licence agreement, for example, using a 'cleanroom'
in certain circumstances. I recently left my job working on the IBM JVM
(specifically, the API spec. implementation), but I won't forget working
on the JCE implementation, never being permitted to look at the Sun
source, but the fellow who sat near me could. It's all a big circus
show, even ignoring the flaws of copyright legislation.

Signature

Tony Morris
http://tmorris.net/

odwrotnie - 06 Mar 2006 13:48 GMT
Thank You very much!

Signature

Best regards,
Odwrotnie.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.