简体   繁体   中英

When I Syn between sql server & sqlite I got this error “ GC_FOR_MALLOC”

I want to synchronization with SQL server 2008 & sqlite.Coding wise ok.Everything is perfect.But after start download , after few records inserted or updated on the table, its say this error.& screen goes to initial screen....

      08-05 09:34:40.798: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 5159 objects / 408216 bytes in 64ms
08-05 09:34:40.898: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 480 objects / 52832 bytes in 60ms
08-05 09:34:40.908: INFO/dalvikvm-heap(278): Grow heap (frag case) to 3.162MB for 130576-byte allocation
08-05 09:34:40.998: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 14 objects / 65568 bytes in 84ms
08-05 09:34:41.138: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 2 objects / 48 bytes in 81ms
08-05 09:34:41.138: INFO/dalvikvm-heap(278): Grow heap (frag case) to 3.349MB for 261648-byte allocation
08-05 09:34:41.308: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 1 objects / 130584 bytes in 159ms
08-05 09:34:41.438: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 2 objects / 48 bytes in 72ms
08-05 09:34:41.448: INFO/dalvikvm-heap(278): Grow heap (frag case) to 3.724MB for 523792-byte allocation
08-05 09:34:41.688: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 1 objects / 261656 bytes in 230ms
08-05 09:34:41.798: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 20 objects / 984 bytes in 90ms
08-05 09:34:41.808: INFO/dalvikvm-heap(278): Grow heap (frag case) to 4.000MB for 220664-byte allocation
08-05 09:34:41.878: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 0 objects / 0 bytes in 73ms
08-05 09:34:41.988: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 0 objects / 0 bytes in 102ms
08-05 09:34:41.988: INFO/dalvikvm-heap(278): Grow heap (frag case) to 4.420MB for 441312-byte allocation
08-05 09:34:42.068: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 0 objects / 0 bytes in 75ms
08-05 09:34:42.068: INFO/dalvikvm-heap(278): Grow heap (frag case) to 4.631MB for 220664-byte allocation
08-05 09:34:42.298: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 1 objects / 220672 bytes in 227ms
08-05 09:34:42.448: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 2 objects / 220720 bytes in 149ms
08-05 09:34:42.758: INFO/dalvikvm-heap(278): Grow heap (frag case) to 5.052MB for 882608-byte allocation
08-05 09:34:42.908: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 0 objects / 0 bytes in 147ms
08-05 09:34:43.058: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 0 objects / 0 bytes in 153ms
08-05 09:34:43.068: INFO/dalvikvm-heap(278): Grow heap (frag case) to 5.473MB for 441312-byte allocation
08-05 09:34:43.168: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 7 objects / 882832 bytes in 91ms
08-05 09:34:44.008: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 45 objects / 467072 bytes in 67ms
08-05 09:34:44.658: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 11 objects / 363568 bytes in 69ms
08-05 09:34:45.188: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 9 objects / 277048 bytes in 68ms
08-05 09:34:45.848: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 11 objects / 369384 bytes in 68ms
08-05 09:34:46.758: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 13 objects / 492464 bytes in 77ms
08-05 09:34:46.758: INFO/dalvikvm-heap(278): Grow heap (frag case) to 6.116MB for 874544-byte allocation
08-05 09:34:46.928: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 1 objects / 655912 bytes in 156ms
08-05 09:34:47.218: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 4668 objects / 2800512 bytes in 68ms
08-05 09:34:47.578: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 6108 objects / 209152 bytes in 87ms
08-05 09:34:47.948: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 6592 objects / 224560 bytes in 94ms
08-05 09:34:48.408: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 7866 objects / 269816 bytes in 106ms
08-05 09:35:30.348: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 8182 objects / 346272 bytes in 125ms
08-05 09:36:43.779: INFO/ActivityManager(58): Process android.process.acore (pid 160) has died.
08-05 09:36:43.918: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 14265 objects / 696136 bytes in 174ms
08-05 09:38:00.298: DEBUG/dalvikvm(278): GC_FOR_MALLOC freed 20285 objects / 995336 bytes in 233ms
08-05 09:38:00.298: ERROR/dalvikvm(278): HeapWorker is wedged: 78178ms spent inside Lcom/android/internal/os/BinderInternal$GcWatcher;.finalize()V

In the coding I used String & stringBuffer.some table contain 1000 records or more.....

I run this on emulator.That heap size is 200MB which is i set.phone storage it show 21 MB(Internal memory)...

I have read this link also What do GC_FOR_MALLOC, GC_EXPLICIT, and other GC_* mean in Android Logcat? .

In my code I am using System.out.println() also for testing purpose.That one aslo isuess and logcat show lot of messages,is that also performance issue? What is the solution for this? Please help me on this..

Thanks in advance

Hmm, GC is usually only performed when there is a need for it. Try debugging the code to see what might be using so much memory. There must not be enough memory left on the heap to perform an allocation.

Curious, are you using sockets for this type of application? I have heard where a front-end application written on Android in Java connects through a socket to a back-end server (not a "Service", in Android terms) written in C. During stress-testing, the server was killed to see how the app would react. When this happened, the device would flood the log with this kind of error. This was because there was a separate thread which ran once it connected, and it would send a request for data, expecting to receive something back from a server that was no longer there.

Perhaps your application or web server believes it is still connected, has a process running that is trying to send/receive data, or something similar.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM