summaryrefslogtreecommitdiff
path: root/compiler/optimizing/scheduler_arm.cc
diff options
context:
space:
mode:
author Mythri Alle <mythria@google.com> 2024-01-16 11:39:04 +0000
committer Mythri Alle <mythria@google.com> 2024-01-26 04:44:22 +0000
commit6f13c5541443a0a98c2c0d71228c8af75bc4fddc (patch)
tree414e98fbfb90c06e102ee18e4d0c7bc47bf9ee10 /compiler/optimizing/scheduler_arm.cc
parent360b1d08e4eaca3e15255265ab534844f2208d61 (diff)
Use a pool of buffers to be used as per-thread trace buffers
We used to allocate a new buffer each time the per-thread trace buffer was full. The old buffer was enqueued in a task queue which is then flushed by a thread pool worker. Thread pool worker can be slow to flush and release these buffers and it increases the memory usage especially on heavy apps with multiple threads. This causes LMKs and OOMs. It is not great in general to have unbounded memory usage for tracing. So this CL allocates a pool of buffers that would be used as a per-thread buffer. If there's no free buffer, we flush the buffer at the head of the task queue into the file and use that buffer. On google maps app, the earlier approach causes LMKs for traces greater than 45-60 seconds. With this approach, we can collect traces of a much longer duration. The performance impact is not too noticeable. In the earlier case a large memory usage was slowing down the app too. Bug: 259258187 Test: art/test.py --trace --stream Change-Id: Ic02f26e2cd14b9ffb1a046e119e03fb4cd022305
Diffstat (limited to 'compiler/optimizing/scheduler_arm.cc')
0 files changed, 0 insertions, 0 deletions