Android Question memory usages between a class and a module

JakeBullet70

Well-Known Member
Licensed User
Longtime User
Hi all.

So memory usages between a class and a module? I know when class has no references Java will free it up and reclaim the memory but what about a module?

Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This question has nothing to do with Java. It is better to edit the thread title.
Code itself doesn't require memory. The objects referenced from the process global variables will not be released until the variables point to a different object. It is very unlikely that you should do anything special to release the memory.
 
Upvote 0

JakeBullet70

Well-Known Member
Licensed User
Longtime User
Sorry Erel.

I should clarify. Not talking about process global's.
I did modify the thread title but I do believe this has everything to do with Java.

If I have a 3000 lines in a module, NOT a class... and call one method. Does Java load all 3000 lines to find that one method?
OR... Did it just load it on startup? Did I waste the RAM for 3000 lines of code to call a sub with 30 lines of code?

If i Have class and do not instantiate it? Not used it at the moment. Maybe never used in the current configuration. Is my class in memory not being used but waiting? Or does java wait for me to make the call and then allocate memory?

Thanks.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0
Top