Meartan / android-scripting

Automatically exported from code.google.com/p/android-scripting
1 stars 0 forks source link

My app is doing excessive garbage collection after running for the first time. #686

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What device(s) are you experiencing the problem on?
   All android smartphones - current test device Samsung GT-P3110

What firmware version are you running on the device?
    Latest firmware for Samsung GT-P3110

What steps will reproduce the problem?
    Install the app and then run it 2 times

What is the expected output? What do you see instead?
    The app runs fine but starts very slowly - always about 8 seconds

What version of the product are you using? On what operating system?
    Latest script-for-android-template on android 4.1.1

Please provide any additional information below.
    I have lots of GC_CONCURRENT entries in my log file followed by these two lines:
1) D/sl4a.ScriptService:185( 9709): No need to update 
/data/data/com.langtech.wikitestswebsite/files/content.zip
2) D/sl4a.ScriptService:163( 9709): Checking if 
/data/data/com.langtech.wikitestswebsite/files/script.py exists

    The first time I run my app these GC_CONCURRENT entries do not appear and are clearly delaying my app starting. It would appear that the integrity of the files is being checked at start up.

Extract from logfile:
......
......
D/dalvikvm( 9709): GC_CONCURRENT freed 406K, 13% free 7582K/8711K, paused 
12ms+12ms, total 45ms

D/dalvikvm( 9709): GC_CONCURRENT freed 406K, 13% free 7583K/8711K, paused 
12ms+13ms, total 43ms

D/dalvikvm( 9709): GC_CONCURRENT freed 407K, 13% free 7582K/8711K, paused 
12ms+12ms, total 43ms

D/dalvikvm( 9709): GC_CONCURRENT freed 406K, 13% free 7582K/8711K, paused 
12ms+12ms, total 50ms

D/sl4a.ScriptService:185( 9709): No need to update 
/data/data/com.langtech.wikitestswebsite/files/content.zip

D/sl4a.ScriptService:163( 9709): Checking if 
/data/data/com.langtech.wikitestswebsite/files/script.py exists

Original issue reported on code.google.com by andy.e.r...@gmail.com on 9 May 2013 at 8:56

Attachments:

GoogleCodeExporter commented 9 years ago
I've fixed the problem by modifying the function "needsToBeUpdated(String 
filename, InputStream content)" in the file ScriptService.java". I'm just 
checking if my application is already installed and if it is I'm not doing any 
updating. 

Original comment by andy.e.r...@gmail.com on 12 May 2013 at 11:31