when i run my program, logcat shows a lot of activity with GC
like
GC freed 10324 objects/ 510376 bytes in 103 ms
GC freed 10324 objects/ 510376 bytes in 103 ms
GC freed 10324 objects/ 510376 bytes in 103 ms
GC freed 10324 objects/ 510376 bytes in 103 ms
GC freed 10324 objects/ 510376 bytes in 103 ms
with diff in obj, bytes and ms values...
is it because of some bad practice of coding ?
Use the standalone DDMS program and its Allocation Tracker tab to check where/what is being allocated. The DDMS program ships with the sdk. (This is not the same as the ddms tab in Eclipse.)
If your program dont necessarily needs to dispose of that many objects, then yes. Otherwise, no. If your program needs to run faster or is for example a game that needs to run smooth at all times, then you might try re-using objects to a greater extent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With