Shuang Liu
Posts: 0
Joined: Wed Jun 26, 2013 2:31 pm

memory optimization? GC bug on Android webview?

Hi,

I found this problem since day one, the memory usage of the APP by jquery mobile & phonegap on your platform can be too large on mobile deices. (bigger and bigger actually)

I have tried so many ways to minimize the memory in my project(basically no global variables), but it till cost more and more with long term usage(gmaps are highly involved in my app).

On Android (apk exported by appery), It seems like the GC is not working at all, the memory will be larger and larger, can be to 150+ mb.
When I test with Chrome, the memory will be 4050 mb when it starts, and grow to 6070 mb while using it.

Is there any bug on Android webview (phonegap activity made by appery)? or is this a bug of Appery framework made by jquerymobile?

Anyway, could you give me some ideas to optimize the memory in my project(could share with support team)?

Thanks

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

memory optimization? GC bug on Android webview?

Hello! As we know PhoneGap doesn't have any problems with memory leak on Android. GC also works. You would need to check your project. Delete links to unnecessary objects, make navigation to between screens with full refresh.

Shuang Liu
Posts: 0
Joined: Wed Jun 26, 2013 2:31 pm

memory optimization? GC bug on Android webview?

Hi Marina, the confusion for me right now is the memory only takes 1020 mb on desktop chrome which I think is normal and good, but on Android, it takes over 40 mb at beginning, and could go over 150 mb while using (larger and larger actually).

I have basically no global variables(only some defined value) in my project, so what could cause that problem? local variables?

By the way, I rendered all html into one page (your template), so the full refresh doesn't help too much.

To conclude, my question is why we got too different memory usage on Chrome and Android.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

memory optimization? GC bug on Android webview?

Hi Shuang,

The difference is large, since there are completely different platforms. Built Android browser is not a copy of Chrome. It's a completely different product with a different JavaScript engine, and then another Garbage Collector.

Further, Google Maps processes large data amount, caches maps in case of return (in the current move on the map.) In addition, the code is designed to perform under the desktop.

In any case, we do not have the technical ability to control the Garbage Collector in the application.

Write your code as efficiently as possible (no global variables is only one of the popular errors for memory leaks) and put your trust in the reliability of the external plug-ins code.

Chitresh Goyal
Posts: 0
Joined: Thu Feb 20, 2014 1:33 pm

memory optimization? GC bug on Android webview?

Hi Shuang,

You should delete all objects after use. for example

@a = object

--- ---

@a = null;
delete @a;

also you should resize your assets folder if it is too large. because rendering use lot of memory.

On android device this problem appears because, GC doesn't work.

rakesh r
Posts: 0
Joined: Thu Sep 11, 2014 7:13 am

memory optimization? GC bug on Android webview?

Hi Shuang,

i am also stucked with same issue with my app also taking huge amount of memory.
do you found any solution for your problem.

give me some information on it

Return to “Issues”