Efficiently cloning an unknown Object that does not supports clone
<p>I am constructing a framework where I need to make copies of objects at runtime and I do not want to force those object classes to implement any interface, like Cloneable, or Prototype pattern, or anything else.</p>

<p>So, for that purpose I was planning to efficiently clone those objects using the functionality of <code>sun.misc.Unsafe</code> and its methods: <code>allocateInstance(Class cls)</code> and <code>copyMemory(Object srcBase,  long srcOffset,  Object destBase,  long destOffset, long bytes)</code>. But I cannot find any way to get the size of an object in bytes in the heap space.</p>

<p>I know that I can use reflection and copy from field to field. But that is not no efficient. 
Do you know any manner of getting the size of an object in the heap? Or any other way of efficiently copying an object?</p>
