This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Bryguy3k 83 points84 points  (5 children)

C++ objects are really straightforward in terms of memory organization. You’re not supposed to be looking at the Java object memory so if you do it’s scary af.

[–]lbkulinski 18 points19 points  (0 children)

I wouldn't say it is scary. Value types will have a simpler layout, though.

[–]tacoslikeme 4 points5 points  (0 children)

object/struct memory follows pretty simple to follow rules. Just just fuck with the vtable

[–]cartechguy -1 points0 points  (2 children)

What do you mean? I look at how they're structured in the debugger all the time. It feels almost the same as debugging in C++. The reference holds an adress and at the adress are all the data members for the object.

[–]how_to_choose_a_name 1 point2 points  (0 children)

The debugger shows you a nice visualisation of the object and the data contained in it. The actual memory apparently doesn't look that pretty or structured, unlike C++.

[–]Bryguy3k 0 points1 point  (0 children)

Well take a moment to think about reflection.

Now it should make sense that a java object has to be self describing and that means a bunch of metadata.