Can startMethodTracing () return an error if the buffer is full?

Debug.startMethodTracing() uses a buffer size of 8 MB by default. I have a few questions about this buffer.

  • Is an error caused when filling the buffer to capacity or just stop recording?
  • Does the buffer remain fixed 8 MB regardless of how much or little data is written to it?
  • If I manually specify the bufferSize parameter, what are the units? B MB?
  • I tried to increase the size of my buffer to 20 MB or so, and the application exits. I need to record about 20 calculations in seconds in real time. Is there a way to log more data than 20 MB or so? I assume that it is first stored in memory, otherwise there would be no problem storing it on an SD card.
+4
source share
1 answer

I did some tests and found:

  • If the buffer fills the tank, the following message is displayed with a LogCat message at the "info" level: TRACE STOPPED (NOTE: overflowed buffer): writing X records

  • The buffer ranges from 0 to 8 MB depending on how much data is written.

  • The bufferSize parameter bufferSize specified in bytes.

  • To increase the number of emulated devices, open AVD Manager and edit your virtual device. Press the new hardware button and select Device Size. On my machine, the largest I could enter was 1GB (value 1000).

+6
source

Source: https://habr.com/ru/post/1413053/


All Articles