JakeBullet70 Well-Known Member Licensed User Longtime User Sep 26, 2016 #1 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
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 Sep 26, 2016 #2 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
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.
JakeBullet70 Well-Known Member Licensed User Longtime User Sep 26, 2016 #3 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
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.
Erel B4X founder Staff member Licensed User Longtime User Sep 27, 2016 #4 It has nothing to do with Java programming language. It is related to how code is managed in the Dalvik virtual machine or ART runtime. You can read more about it here: http://www.anandtech.com/show/8231/a-closer-look-at-android-runtime-art-in-android-l/ The code itself doesn't have any significant impact on the memory required and there is no difference between a static module and a class. Upvote 0
It has nothing to do with Java programming language. It is related to how code is managed in the Dalvik virtual machine or ART runtime. You can read more about it here: http://www.anandtech.com/show/8231/a-closer-look-at-android-runtime-art-in-android-l/ The code itself doesn't have any significant impact on the memory required and there is no difference between a static module and a class.
JakeBullet70 Well-Known Member Licensed User Longtime User Sep 27, 2016 #5 Ah the runtime's. Clear now. Thanks. Upvote 0