iOS Question Memory size of an object

mrred128

Active Member
Licensed User
Longtime User
I have created an app that generates rather large map arrays. Is there a way to find out how large an object actually is in memory?
 

wonder

Expert
Licensed User
Longtime User
There is no way to find the object memory size.
Wouldn't it be possible just by doing the math?
Each Boolean/Char (in a string) = 1 byte, Each short = 4 bytes, Each Int/Float = 8 bytes, Each Long/Double = 16 bytes, Each ARGB Pixel (in an image) = 4 bytes*

*Note: The image size would probably be smaller, due to compression. For a rough estimate, if you know the compression rate, just do the math.
Erel said:
Note that bitmaps are not compressed in memory.
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
My point is that it is unlikely to be a real issue. However we must wait for more information to be able to determine it.

*Note: The image size would probably be smaller, due to compression. For a rough estimate, if you know the compression rate, just do the math.
Note that bitmaps are not compressed in memory.
 
Upvote 0

mrred128

Active Member
Licensed User
Longtime User
I asked the question beceause I have no idea of the overhead. My maps tend to be several thousand in records and they contain documents. Java has abilities to do this, but I have no idea on how objective-c does this, if at all.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…