[talk] Python

Edward Capriolo edlinuxguru at gmail.com
Thu Apr 28 10:23:05 EDT 2016


Could you please clarify further? I mean does it involve a object size
>> >>> on the JVM.

You can count the size of objects in memory. Check the first link:

http://www.javaworld.com/article/2077408/core-java/sizeof-for-java.html

You can also just ask the Java VM via remote management how much heap is
being used.
http://wiki.genexus.com/commwiki/servlet/wiki?6340,Monitoring+Memory+Management+with+JMX

As the article points out the calculation is not as simple as c++ sizeof,
because the VM is always doing things there is overhead etc.

I have taken my laptop and instantiated a linked list. I added objects to a
LinkedList until the system ran out of memory. In other words construct
1000000 objects sample, construct 2000000 objects sample. You can
approximate the answer.

I dont want to name names and get people upset that I am saying Java is
better than $there_fav_language_x , But  interpreted languages that store
objects as maps internally suffer in this regard.

JIT optimizes method and code branches based on heuristics. The class
definitions and size of an instance in memory are fixed and I do not
believe JIT optimizes them in any way.

On Thu, Apr 28, 2016 at 10:04 AM, Sujit K M <kmsujit at gmail.com> wrote:

> On Thu, Apr 28, 2016 at 7:26 PM, Edward Capriolo <edlinuxguru at gmail.com>
> wrote:
> > "No Size of In Java Is what I see in this document.
> >
> > But let me take a guess, Every programmer has to calculate his object
> > size an then
> > see whether it is actually equal to file size on his disk. Or better
> > still add a commit hook
> > to check and do a basic primitive validation."
> >
> > It is rather easy to pick something declare you do not like it, and then
> > cherry pick all the things "wrong" with it.
>
> You seem to be claiming a wizard, which I have no way of knowing or
> wanting.
>
> Before you pass comment please answer the below questions that I had asked
> in a very polite tone. Below Questions
>
> >> >>> Could you please clarify further? I mean does it involve a object
> size
> >> >>> on the JVM.
> >> >>> How to measure the size occupied by the Object? How much extra space
> >> >>> the
> >> >>> JVM
> >> >>> needs? What is JDK Feature that Let's you claim this?
> >> >>>
> >> >>> I have serious questions regarding this claim. As Interpreted or JIT
> >> >>> compiled languages
> >> >>> should in reality occupy more space.
>
> _______________________________________________
> talk mailing list
> talk at lists.nycbug.org
> http://lists.nycbug.org/mailman/listinfo/talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nycbug.org/pipermail/talk/attachments/20160428/12b14008/attachment.html>


More information about the talk mailing list