App freezes on start giving "E/dalvikvm﹕ GC_EXPLICIT freed" messages in logcat

87 views Asked by At

My app is freezing on start giving continous "E/dalvikvm﹕ GC_EXPLICIT freed" messages in logcat. I am not sure what can be the problem. Sometimes it starts nice, but sometimes freezes throwing this messages. So where I should look for a problem? It gives me some Integer parsing errors before, but it is giving also when application starts properly, so I think it is not correlated?

       06-18 16:46:39.229  25269-25269/com.example.krusty.drugi D/memalloc﹕ /dev/pmem: Mapped buffer base:0x4bca7000 size:6205440 offset:4669440 fd:50
06-18 16:46:39.599  25269-25269/com.example.krusty.drugi D/memalloc﹕ /dev/pmem: Mapped buffer base:0x4c312000 size:12165120 offset:10629120 fd:53
06-18 16:46:39.829  25269-25269/com.example.krusty.drugi W/System.err﹕ java.lang.NumberFormatException: Invalid int: ""
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at java.lang.Integer.invalidInt(Integer.java:138)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at java.lang.Integer.parseInt(Integer.java:359)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at java.lang.Integer.parseInt(Integer.java:332)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at java.util.Calendar.getHwFirstDayOfWeek(Calendar.java:807)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at java.util.Calendar.<init>(Calendar.java:745)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at java.util.GregorianCalendar.<init>(GregorianCalendar.java:338)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at java.util.GregorianCalendar.<init>(GregorianCalendar.java:239)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at java.util.Calendar.getInstance(Calendar.java:1086)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at com.example.krusty.drugi.MainActivity.ListDrwaer(MainActivity.java:227)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at com.example.krusty.drugi.MainActivity$JsonReadTask.onPostExecute(MainActivity.java:197)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at com.example.krusty.drugi.MainActivity$JsonReadTask.onPostExecute(MainActivity.java:152)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at android.os.AsyncTask.finish(AsyncTask.java:602)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at android.os.AsyncTask.access$600(AsyncTask.java:156)
06-18 16:46:39.839  25269-25269/com.example.krusty.drugi W/System.err﹕ at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:615)
06-18 16:46:39.849  25269-25269/com.example.krusty.drugi W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:99)
06-18 16:46:39.849  25269-25269/com.example.krusty.drugi W/System.err﹕ at android.os.Looper.loop(Looper.java:137)
06-18 16:46:39.849  25269-25269/com.example.krusty.drugi W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:4424)
06-18 16:46:39.849  25269-25269/com.example.krusty.drugi W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
06-18 16:46:39.849  25269-25269/com.example.krusty.drugi W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:511)
06-18 16:46:39.849  25269-25269/com.example.krusty.drugi W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
06-18 16:46:39.849  25269-25269/com.example.krusty.drugi W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
06-18 16:46:39.849  25269-25269/com.example.krusty.drugi W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
06-18 16:46:41.279  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 808K, 13% free 9755K/11107K, paused 4ms+6ms
06-18 16:46:43.119  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 722K, 11% free 10073K/11299K, paused 6ms+13ms
06-18 16:46:44.429  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 986K, 13% free 10127K/11619K, paused 4ms+15ms
06-18 16:46:46.819  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1007K, 14% free 10161K/11683K, paused 4ms+16ms
06-18 16:46:48.139  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1012K, 14% free 10190K/11747K, paused 3ms+9ms
06-18 16:46:49.059  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 950K, 13% free 10282K/11747K, paused 4ms+10ms
06-18 16:46:50.229  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1021K, 14% free 10303K/11875K, paused 5ms+9ms
06-18 16:46:51.309  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1034K, 14% free 10311K/11875K, paused 8ms+18ms
06-18 16:46:52.239  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1013K, 13% free 10339K/11875K, paused 3ms+9ms
06-18 16:46:53.069  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1042K, 14% free 10340K/11939K, paused 2ms+10ms
06-18 16:46:53.859  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1024K, 14% free 10358K/11939K, paused 3ms+10ms
06-18 16:46:54.769  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1042K, 14% free 10359K/11939K, paused 2ms+9ms
06-18 16:46:55.739  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1040K, 14% free 10361K/11939K, paused 3ms+9ms
06-18 16:46:56.709  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1043K, 14% free 10361K/11939K, paused 3ms+12ms
06-18 16:46:57.679  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1040K, 14% free 10364K/11939K, paused 3ms+10ms
06-18 16:46:58.629  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1040K, 14% free 10367K/11939K, paused 3ms+12ms
06-18 16:46:59.569  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1043K, 14% free 10367K/11939K, paused 3ms+10ms
06-18 16:47:00.589  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1040K, 14% free 10369K/11939K, paused 3ms+9ms
06-18 16:47:01.489  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1043K, 14% free 10369K/11939K, paused 4ms+11ms
06-18 16:47:02.389  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1040K, 14% free 10372K/11939K, paused 3ms+11ms
06-18 16:47:03.199  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1043K, 14% free 10372K/11939K, paused 3ms+10ms
06-18 16:47:03.939  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1040K, 14% free 10375K/11939K, paused 3ms+9ms
06-18 16:47:04.709  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1043K, 14% free 10375K/11939K, paused 3ms+9ms
06-18 16:47:05.559  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1040K, 14% free 10378K/11939K, paused 3ms+9ms
06-18 16:47:06.369  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1043K, 14% free 10378K/11939K, paused 2ms+10ms
06-18 16:47:07.109  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1043K, 14% free 10378K/11939K, paused 2ms+9ms
06-18 16:47:07.939  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1040K, 14% free 10380K/11939K, paused 3ms+8ms
06-18 16:47:08.779  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1043K, 14% free 10380K/11939K, paused 3ms+10ms
06-18 16:47:09.519  25269-25269/com.example.krusty.drugi E/dalvikvm﹕ GC_EXPLICIT freed 1038K, 14% free 10386K/11939K, paused 3ms+9ms
1

There are 1 answers

5
shkschneider On

NumberFormatException: Invalid int: ""

Open you code, file MainActivity.java at line 227.

You are parsing a Integer (seems like with Calendar) that is "", throwing an NumberFormatException because "" is not considered as a number, unlike "0".

To solve your issue, check what you give to Calendar. One of its parameters should be in this case "", which is invalid.

You can avoid this by checking for null and empty strings with TextUtils.isEmpty().