Encode flatbuffers directly into the encoder when logging
We were running out of memory when running for many hours. Initial
debugging looked like it was a heap fragmentation issue. Tracking the
allocated memory using the malloc hooks wasn't showing any growth of
memory. The heap was growing though.
Instead of allocating a FlatBufferBuilder/DetachedBuffer for each
message to be logged, we can instead have the BufferEncoder provide
memory to write to, and have it only alloate that buffer space once, and
allocate it to the maximum size that a writer might see.
Change-Id: I046bd2422aea368867b0c63cee7d04c6033fe724
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/starter/BUILD b/aos/starter/BUILD
index 5bf3811..d4566a0 100644
--- a/aos/starter/BUILD
+++ b/aos/starter/BUILD
@@ -188,12 +188,16 @@
"$(rootpath //aos/events:ping)",
"$(rootpath //aos/events:pong)",
"$(rootpath :aos_starter)",
+ "$(rootpath //aos:aos_dump)",
+ "$(rootpath //aos/events/logging:logger_main)",
],
data = [
":aos_starter",
":starterd",
+ "//aos:aos_dump",
"//aos/events:ping",
"//aos/events:pingpong_config",
"//aos/events:pong",
+ "//aos/events/logging:logger_main",
],
)