<div dir="ltr"><span style="font-size:12.8000001907349px">Could you please clarify further? I mean does it involve a object size</span><br style="font-size:12.8000001907349px"><span style="font-size:12.8000001907349px">>> >>> on the JVM.</span><br><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">You can count the size of objects in memory. Check the first link:</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><a href="http://www.javaworld.com/article/2077408/core-java/sizeof-for-java.html">http://www.javaworld.com/article/2077408/core-java/sizeof-for-java.html</a></span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">You can also just ask the Java VM via remote management how much heap is being used.</span></div><div><span style="font-size:12.8000001907349px"><a href="http://wiki.genexus.com/commwiki/servlet/wiki?6340,Monitoring+Memory+Management+with+JMX">http://wiki.genexus.com/commwiki/servlet/wiki?6340,Monitoring+Memory+Management+with+JMX</a></span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">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. <br><br>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 2</span><span style="font-size:12.8000001907349px">000000 objects sample. You can approximate the answer. </span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">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. </span></div><div><br></div><div><span style="font-size:12.8000001907349px">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. </span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 28, 2016 at 10:04 AM, Sujit K M <span dir="ltr"><<a href="mailto:kmsujit@gmail.com" target="_blank">kmsujit@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Apr 28, 2016 at 7:26 PM, Edward Capriolo <<a href="mailto:edlinuxguru@gmail.com">edlinuxguru@gmail.com</a>> wrote:<br>
> "No Size of In Java Is what I see in this document.<br>
><br>
> But let me take a guess, Every programmer has to calculate his object<br>
> size an then<br>
> see whether it is actually equal to file size on his disk. Or better<br>
> still add a commit hook<br>
> to check and do a basic primitive validation."<br>
><br>
> It is rather easy to pick something declare you do not like it, and then<br>
> cherry pick all the things "wrong" with it.<br>
<br>
You seem to be claiming a wizard, which I have no way of knowing or wanting.<br>
<br>
Before you pass comment please answer the below questions that I had asked<br>
in a very polite tone. Below Questions<br>
<br>
>> >>> Could you please clarify further? I mean does it involve a object size<br>
>> >>> on the JVM.<br>
>> >>> How to measure the size occupied by the Object? How much extra space<br>
>> >>> the<br>
>> >>> JVM<br>
>> >>> needs? What is JDK Feature that Let's you claim this?<br>
>> >>><br>
>> >>> I have serious questions regarding this claim. As Interpreted or JIT<br>
>> >>> compiled languages<br>
>> >>> should in reality occupy more space.<br>
<br>
_______________________________________________<br>
talk mailing list<br>
<a href="mailto:talk@lists.nycbug.org">talk@lists.nycbug.org</a><br>
<a href="http://lists.nycbug.org/mailman/listinfo/talk" rel="noreferrer" target="_blank">http://lists.nycbug.org/mailman/listinfo/talk</a><br>
</blockquote></div><br></div>