Debug.startMethodTracing()
by default uses an 8MB "buffer size". I have a number of questions about this buffer.
- Is an error thrown if the buffer fills to capacity, or does it just stop logging?
- Does the buffer remain a fixed 8MB regardless of how much or little data written to it?
- If I manually specify the
bufferSize
parameter, what are the units? Bytes? MB? - I tried growing my buffer size past 20MB or so and the app exits. I need to log about 20 real-time seconds worth of computation. Is there any way to log more data than 20MB or so? I assume it's first stored in memory, otherwise there would be no problem storing it to the SD card.
I ran some tests and found:
If the buffer fills to capacity, the following "info" level LogCat message is displayed:
TRACE STOPPED (NOTE: overflowed buffer): writing X records
The buffer is between 0 and 8MB depending upon how much data is written.
The
bufferSize
parameter is specified in bytes.To increase the amount of emulated device ram, open the AVD manager and edit your virtual device. Click on the new hardware button and select Device ram size. On my machine the largest I could enter was 1GB (value 1000).