I don’t how to ask this question but I want to create an object in a specific address (memory) and with specific size. For example, class A {int, string, class B, List<array>} shouldn’t be more than 30 MB otherwise throws an error NoMoreMemoryException
I know there is no pointer in Java (even if C++ hackers insist) but how to point to a specific address?
an important aspect of the JVM is that memory is abstracted. You really can’t point to a specific address in memory.
You can get the size of an object in memory. Look here for details