Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change size of logcat buffer in Android?

Tags:

android

I noticed that the size of the logcat buffer varies on different devices. Assuming I have root permissions on my device, is there a way to change the buffer size of the main buffer at runtime? If not, then assuming I can rebuild the Android image, how do I change it at compile time? I'm looking to enlarge it for diagnostic purposes.

like image 964
zer0stimulus Avatar asked Sep 13 '12 00:09

zer0stimulus


People also ask

What is the best logger buffer size for Android?

Buffer size: A general rule is that a buffer size of 10 MB per CPU core allows for a trace that's about 20 seconds long.

What is logger buffer size in Android?

Logger Buffer Sizes option allows you to change the buffer size of these mentioned buffers. Increasing the buffer size would allow you to capture more logs in the buffer, and reducing the probability of an overwrite in case of high-frequency logs. Setting the option to "OFF" would disable logging.

What is Logcat buffer?

Logcat is a command-line tool that dumps a log of system messages, including stack traces when the device throws an error and messages that you have written from your app with the Log class. This page is about the command-line logcat tool, but you can also view log messages from the Logcat window in Android Studio.


1 Answers

"Logger buffer size option" in "Developer options"

It allows to change the size to a few values between 64k and 16M.

adb logcat -g then immediately shows the update limit.

Tested on 5.1.1, and this answer claims that it is a recent addition.