breautek commented on issue #1498:
URL: 
https://github.com/apache/cordova-android/issues/1498#issuecomment-1256840327

   > When you are talking about "reload the webview sometimes ...", 
   
   I mean clicking the refresh button, or using the ctrl + r keyboard shortcut. 
I like never use window.reload.
   
   I don't really think Cordova caches anything. Cordova doesn't implement the 
webview and control over the webview is fairly limited. And everything inside 
the JS VM would be pretty much exclusive to the webview resources, things that 
Cordova cannot directly manipulate. As far as I know, resources related to a 
particular page is freed once the document is unloaded.
   
   What Cordova does do however, is allow plugins to be loaded up, which can 
hold some state/memory/whatever, and this state can persist through webview 
unloads/reloads, or even a complete destruction of the underlying native 
webview object, for as long as the application itself isn't killed. This 
wouldn't be included in the JS VM memory though as seen in the chrome web 
inspector (unless plugins are sending stuff to the webview and creating lots of 
JS objects).
   
   I don't have time to look at the application right now, but if I remember 
I'll try to look at it tomorrow (assuming I have power... hurricane season :D).
   
   In the meantime though, you might get better insights if you use the memory 
heap tools for collecting snapshots/allocations over time, which can also 
record stacktraces. After running through the reproduction a few times, you 
might be able to see a pattern.
   
   How large does the VM size grow anyway according to the dev tools? They can 
grow quite large, assuming device memory permits, up to ~1gb of RAM (regardless 
if device has plenty of RAM or not).
   
   You can also load up the project in Android Studio (the android studio 
project will be located at `<cordova-project-root>/platforms/android`, and 
utilise the performance audit tools to keep track of memory consumption, which 
will give you insights on what is happening on the native side (which would 
include webview memory usage, but you wouldn't be able to inspect the webview 
memory in detail like web inspector)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to