I am using adb shell logcat -v time filename command programmatically to store logs into a file on an android device.
There are some internal logs for memory releasing activities which are stored under " dalvikvm " tag. (See the logs below). I don't have any problem with these logs but due to these logs, the log file gets heavier.
So my concern is reduce logs which have GC_CONCURRENT freed or WAIT_FOR_CONCURRENT_GC text in it.
I also tried to reduce logs by using it's tag, but it removes all logs related to that tag. I don't want to loose required tags under same tag name. I just don't want the logs which have GC_CONCURRENT freed or WAIT_FOR_CONCURRENT_GC text in it.
Is there any way or any adb command to resolve this problem. Thanks in advance.
04-18 01:02:53.644: D/dalvikvm(4302): GC_CONCURRENT freed 511K, 21% free 4106K/5192K, paused 5ms+1ms, total 19ms
04-18 01:02:53.644: D/dalvikvm(4302): WAIT_FOR_CONCURRENT_GC blocked 6ms
04-18 01:02:53.684: D/dalvikvm(4302): GC_CONCURRENT freed 512K, 21% free 4106K/5192K, paused 1ms+1ms, total 15ms
04-18 01:02:53.684: D/dalvikvm(4302): WAIT_FOR_CONCURRENT_GC blocked 6ms
04-18 01:02:53.724: D/dalvikvm(4302): GC_CONCURRENT freed 512K, 21% free 4106K/5192K, paused 2ms+1ms, total 16ms
04-18 01:02:53.724: D/dalvikvm(4302): WAIT_FOR_CONCURRENT_GC blocked 6ms
04-18 01:02:53.764: D/dalvikvm(4302): GC_CONCURRENT freed 512K, 21% free 4106K/5192K, paused 1ms+1ms, total 16ms
04-18 01:02:53.764: D/dalvikvm(4302): WAIT_FOR_CONCURRENT_GC blocked 7ms
EDIT
I am using
adb shell logcat -v time | grep -v \"GC_CONCURRENT\\|WAIT_FOR_CONCURRENT_GC\" > " + filename command.
It was working when I gave filename as my computer's local path.
But when I tried same with android device /data/data/packagename/filename.txt, it was not working.
It says that bash: /data/data/packagename/filename.txt : No such file or directory Can anybody suggest solution for that.
Don't forget that you can use host side utilities with the output from logcat. I would recommend using grep. In particular, with it's -v/--invert-match option.
adb logcat | grep -v "GC_CONCURRENT\|WAIT_FOR_CONCURRENT_GC" > filename
The command to print specific logs using tag names. *:S which dont read logs related to GC_CONCURRENT freed and WAIT_FOR_CONCURRENT_GC
Syntax
adb logcat TAG_NAME:PRIORITY
Below line displays only logs with ActivityManager, MY_CUSTOM_TAG.. tags
adb logcat ActivityManager:I MY_CUSTOM_TAG:D ANOTHER_CUST_TAG:D *:S
S — Silent (highest priority, on which nothing is ever printed)
For more information visit Official Docs
Android Debug Bridge
Reading and Writing Logs
UPDATED Missed dumping to file.
Dump to file
`adb logcat -d ActivityManager:I MY_CUSTOM_TAG:D ANOTHER_CUST_TAG:D *:S > filename.txt`
Related
I cannot understand what is happening here - I have been creating a small project just to learn about rotation of an image. But this is not relevant here.
So - I have been doing this before and know how heap works, but right know I cannot get it.
In this small Eclipse project I put an image in the drawable-mdpi folder. The image is
1300 * 1950
So simply - this image will occupy about the following amount of ram (heap)
10 MB (1300 * 1950 * 4)
Red, gree, blue and Alpha. Thats it!
But what is happening. Well see the logcat below!!! the heap of 63 MB for my Samsung Galaxy S3 is almost exhausted.
02-17 08:50:05.144: I/dalvikvm-heap(21097): Grow heap (frag case) to 22.494MB for 10140016-byte allocation
02-17 08:50:05.164: D/dalvikvm(21097): GC_CONCURRENT freed 1K, 5% free 22152K/23175K, paused 12ms+2ms, total 22ms
02-17 08:50:05.329: D/dalvikvm(21097): GC_FOR_ALLOC freed 0K, 5% free 22152K/23175K, paused 11ms, total 11ms
02-17 08:50:05.429: I/dalvikvm-heap(21097): Grow heap (frag case) to 61.174MB for 40560016-byte allocation
02-17 08:50:05.449: D/dalvikvm(21097): GC_CONCURRENT freed 0K, 2% free 61761K/62791K, paused 11ms+3ms, total 22ms
02-17 08:50:06.109: D/libEGL(21097): loaded /system/lib/egl/libEGL_mali.so
02-17 08:50:06.119: D/libEGL(21097): loaded /system/lib/egl/libGLESv1_CM_mali.so
02-17 08:50:06.124: D/libEGL(21097): loaded /system/lib/egl/libGLESv2_mali.so
02-17 08:50:06.179: D/(21097): Device driver API match
02-17 08:50:06.179: D/(21097): Device driver API version: 10
02-17 08:50:06.179: D/(21097): User space API version: 10
02-17 08:50:06.179: D/(21097): mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Fri Sep 28 10:42:56 KST 2012
02-17 08:50:06.254: D/OpenGLRenderer(21097): Enabling debug mode 0
First it allocates properly - you can see 10 MB (according to my calculations) and a heap well above that - that is 20 MB. So far so good. BUT THEN IT CONTINUES TO ALLOCATE MEMORY FAR ABOVE THAT LEVEL. Like there was another image of 40 MB (4 times the previous) so the allocated heap ends up in 61 MB, almost tangenting out of memory.
What did I miss here or is it a bug? I have checked all the drawable folders and I know I run this app and not another. I recreated the project to be sure, even changed the image name. restarted the computer AND the device
this is the source code
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ImageView imgview = (ImageView) findViewById(R.id.image);
Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.image1);
}
the xml-file
<ImageView
android:id="#+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
more info: The device is rooted
I have a Unity project that is already successfully distributed via Google Play and Amazon Store. It runs on all the Kindle Fire devices as well. Now I have a new version, but for the life of me I can't get it to run on my Kindle Fire test device. Once I build & run, it just stops on a black screen, and the log leaves me scratching my head what might go wrong here. This is all the log being created throughout the start sequence:
I/ActivityStack( 258): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 pkg=de.applicationsystems.CafeIntlSolo cmp=de.applicationsystems.CafeIntlSolo/.CIAndroidPlugin} from pid 794
V/ActivityStack( 258): Prepare open transition: starting ActivityRecord{4180f990 de.applicationsystems.CafeIntlSolo/.CIAndroidPlugin}
V/Sensors ( 258): accel data: -0.177231 -0.162861 9.376501
D/dalvikvm( 258): GC_FOR_ALLOC freed 551K, 30% free 15332K/21703K, paused 46ms
V/ActivityStack( 258): Prepare open transition: prev=ActivityRecord{41bae778 com.amazon.kindle.otter/.Launcher}
I/ActivityManager( 258): Start proc de.applicationsystems.CafeIntlSolo for activity de.applicationsystems.CafeIntlSolo/.CIAndroidPlugin: pid=7240 uid=10022 gids={3003, 1015}
D/dalvikvm( 109): GC_EXPLICIT freed 37K, 3% free 10994K/11331K, paused 1ms+3ms
I/PhoneWindowManager( 258): repositioning status bar
D/dalvikvm( 258): GC_CONCURRENT freed 52K, 25% free 16369K/21703K, paused 2ms+7ms
D/AmazonToggle( 449): setText toggle_on
D/AmazonToggle( 449): setText toggle_off
D/QuickSettings-Wifi( 449): handleSelection Begin
D/dalvikvm( 109): GC_EXPLICIT freed <1K, 3% free 10994K/11331K, paused 9ms+2ms
D/dalvikvm( 109): GC_EXPLICIT freed <1K, 3% free 10994K/11331K, paused 1ms+2ms
D/dalvikvm( 7240): GC_FOR_ALLOC freed 176K, 3% free 11201K/11527K, paused 18ms
I/dalvikvm-heap( 7240): Grow heap (frag case) to 12.027MB for 1048592-byte allocation
D/dalvikvm( 7240): GC_CONCURRENT freed 1K, 4% free 12224K/12615K, paused 3ms+1ms
D/dalvikvm( 7240): Trying to load lib /data/data/de.applicationsystems.CafeIntlSolo/lib/libmain.so 0x415f6eb0
D/dalvikvm( 7240): Added shared lib /data/data/de.applicationsystems.CafeIntlSolo/lib/libmain.so 0x415f6eb0
V/Sensors ( 258): accel data: -0.162861 -0.110171 10.054292
V/Sensors ( 258): accel data: -0.148491 -0.110171 10.008786
W/ActivityStack( 258): Launch timeout has expired, giving up wake lock!
W/ActivityStack( 258): Activity idle timeout for ActivityRecord{4180f990 de.applicationsystems.CafeIntlSolo/.CIAndroidPlugin}
V/Sensors ( 258): accel data: -0.220342 -0.119751 9.956097
V/Sensors ( 258): accel data: -0.179626 -0.086221 10.018367
V/Sensors ( 258): accel data: -0.205972 -0.114961 9.996812
D/dalvikvm( 258): GC_CONCURRENT freed 2260K, 30% free 15352K/21703K, paused 2ms+4ms
V/Sensors ( 258): accel data: -0.131726 -0.148491 10.025552
V/Sensors ( 258): accel data: -0.232317 -0.100591 10.039922
The same project just deployed to a Nexus 7 just runs fine, even with the Amazon SDK/GameCircle setup. I already updated all the Android SDKs and the Amazon Unity Plugin, but no change. I've reset the Kindle to factory defaults and tried to install on a fresh machine, but no change. It just won't run. Any ideas how to track that down appreciated!
Answering myself:
You need at least Unity patch 4.6.1p1 from http://unity3d.com/unity/qa/patch-releases. It has the following fix:
(654591) - Android: Fixed freeze during startup on most Amazon Kindle devices.
Note that these patches are not advertised automatically. The latest announced and automatic update was. 4.6.1f1, so it requires you to take explicit action.
Regards, habitoti
Confirmed. 4.6.1p1 fixes the problem. (I think habitoti made a typo with the version)
My previous .apk only worked on the Kindle Fire HDX and not the Kindle Fire HD or original Kindle Fire.
I have been looking to Logcat output for memory performance. With the given data below, how should I understand whether my app is increasing or releasing it? Is it an acceptable performance?
07-23 14:52:05.910: D/dalvikvm(4909): GC_CONCURRENT freed 1332K, 25% free 7791K/10300K, paused 3ms+3ms, total 45ms
07-23 14:52:06.170: D/dalvikvm(4909): GC_CONCURRENT freed 1230K, 25% free 7811K/10300K, paused 4ms+4ms, total 44ms
07-23 14:52:06.360: D/dalvikvm(4909): GC_CONCURRENT freed 1222K, 24% free 7887K/10300K, paused 3ms+4ms, total 53ms
07-23 14:53:08.610: D/dalvikvm(4909): GC_CONCURRENT freed 1315K, 22% free 8061K/10300K, paused 5ms+3ms, total 99ms
There is a monitor app that comes with the Android SDK. You can use to to look at the memory that your app is using. Take a look at this post on the Android Developers blog.
There is nothing intrinsically wrong with the log output.
I'm trying to view LogCat via the command line. I run the following:
"C:\path\to\android-sdk\platform-tools\adb.exe" logcat
and it's displaying the activity that is currently happening. A line by line example of what I'm seeing is
E/StrictMode( 654): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
E/StrictMode( 654): at java.lang.Thread.run(Thread.java:856)
W/ActivityManager( 276): Unbind failed: could not find connection for android.os.BinderProxy#410b51f8
D/dalvikvm( 276): GC_CONCURRENT freed 899K, 15% free 7052K/8276K, paused 9ms+26ms, total 248ms
What switch to I need to provide to include the date/time in the output?
Please try adb logcat -v time
This works for me
I have an app that I have been using for a long while now. It's open source and fell out of development. I started modifying it when it broke and it worked fine on my Epic Touch. I recently picked up the Sprint Note 2 and installed it. It forced closed on me. I decided "OK lets see whats going on and why its FCing". I ran it in an emulator 4.1.2 and it worked fine. When I tried to debug it in eclipse using the real phone my logcat showed problems and never loaded:
D/dalvikvm( 1032): Added shared lib libnativehelper.so 0x0
D/dalvikvm( 1032): Note: class Landroid/app/ActivityManagerNative; has 153 ulemented (abstract) methods
D/AndroidRuntime( 1032): Calling main entry com.android.commands.pm.Pm
W/zipro (30332): Unable to open zip '/data/local/tmp/BalanceWidget.apk': Permission denied
D/asset (30332): failed to open Zip archive '/data/local/tmp/BalanceWidget'
I/ApplicationPolicy( 2487): isApplicationInstallationEnabled
W/zipro (30332): Unable to open zip '/data/local/tmp/BalanceWidget.apk': Permission denied
D/asset (30332): failed to open Zip archive '/data/local/tmp/BalanceWidget'
D/dalvikvm( 2487): WAIT_FOR_CONCURRENT_GC blocked 0ms
W/DefContainer(30332): Failed to parse package
W/PackageManager( 2487): verifying app can be installed or not
W/DefContainer(30332): Failed to parse package
D/dalvikvm( 2487): GC_EXPLICIT freed 329K, 14% free 44856K/51591K, paused 4ms, total 96ms
D/AndroidRuntime( 1032): Shutting down VM
D/dalvikvm( 1032): GC_CONCURRENT freed 128K, 87% free 568K/4096K, paused 0ms, total 2ms
D/jdwp ( 1032): Got wake-up signal, bailing out of select
I tried wiping the cache, chmoding the folders, but nothing worked. I changed to a different project to see if it was that project but it did the same thing.
Does anyone have any ideas on what the problem could be and how to fix it?
My phone:
Rooted Stock Sprint Note 2
L900VPALJC
OS Running - Android 4.1.1
Thanks