From matcdac at gmail.com Mon Nov 13 15:27:14 2017 From: matcdac at gmail.com (Prakhar Makhija) Date: Mon, 13 Nov 2017 20:57:14 +0530 Subject: [jmm-dev] Require some insight regarding Objects Message-ID: *json* {"subCategory":"European","bornLocation":"Pondicherry","name":"Goldi Heathers","someSocialStatus":"Active","prefferedCategory":"Within City","dateOfBeingBorn":"16/11/1987","interestedActivity":"Business","personalEarnings":500000.0,"matchfulDesiredEarnings":1000000.0,"identificationNumber":"X582TQ0170TF47002UTD087X74","prefferedClass":"Private","addressState":"Andaman and Nicobar Islands","someAddress":"House Number 143, Near Pie Beach, Port Blair, Andaman and Nicobar Islands, India - 744101","interestedActivityCode":72681.0,"emailId":"munchymuffin at gmail.com"} *class definition* public class MyClass { private String identificationNumber; private String name; private String someAddress; private String addressState; private String bornLocation; private String someSocialStatus; private String prefferedClass; private String prefferedCategory; private String subCategory; private String dateOfBeingBorn; private String interestedActivity; private Double interestedActivityCode; private Double personalEarnings; private Double matchfulDesiredEarnings; private String emailId; // getters & setters // constructors } *code block* import com.fasterxml.jackson.databind.ObjectMapper; ObjectMapper objectMapper = new ObjectMapper(); MyClass myClassObj = objectMapper.readValue(currentLine.getBytes(), MyClass.class); *topic* Likewise having 1.5 million json files Total size which they are occupying on disk is 940 Mega Bytes My first doubt is when I load all these json, to make objects out of them, will they occupy the same space in the memory? My second doubt is about what is going on internally in the JVM's memory, when I am making 1.5 million objects of MyClass. Lets pick one identifier 'identificationNumber', it has 20 characters. So just this field 'identificationNumber' is going to occupy 40 bytes only, or (40 * 1,500,000) = 60,000,000 bytes = 57.22 MB ???? PS : I am not aware which mailing list should be concerned with this kind of query, could you direct me to them, if you are not aware of what I am asking.