Commit a719fe4
committed
[dbsp] Clear rkyv scratch space from one serialization to the next.
A customer reported large and growing memory use that showed up in heap
profiles attributed to rkyv serialization in the storage file writer. Only
some of this made sense, in particular the part written to FBufs, which
is data blocks that will end up in the cache. The rest was not more
specifically attributed.
Some investigation showed the possibility that data is accumulating in
our per-thread scratch space cache. This cache should get emptied for
every use, but that depends on the rkyv serialization implementations
being correct both in the common case and the error case. DBSP hits the
error case frequently in practice (once per data block), because it uses
errors to avoid going over block size limits. Perhaps the rkyv built-in
implementations handle errors correctly regarding scratch space; I don't
know whether DBSP implementations of serializers do.
If this is the problem, this commit will avoid it, by clearing the scratch
space every time that we use it. It is larger than otherwise necessary
because rkvy's `HeapScratch` and `FallbackScratch` don't provide any way
to clear themselves, so this has to copy in their implementations.
Signed-off-by: Ben Pfaff <blp@feldera.com>1 parent e94b613 commit a719fe4
1 file changed
+87
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | | - | |
82 | | - | |
83 | | - | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | | - | |
87 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
88 | 92 | | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| |||
276 | 281 | | |
277 | 282 | | |
278 | 283 | | |
279 | | - | |
280 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
281 | 348 | | |
282 | 349 | | |
283 | 350 | | |
| |||
339 | 406 | | |
340 | 407 | | |
341 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
342 | 416 | | |
343 | 417 | | |
344 | 418 | | |
| |||
354 | 428 | | |
355 | 429 | | |
356 | 430 | | |
357 | | - | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
358 | 436 | | |
359 | 437 | | |
360 | 438 | | |
| |||
0 commit comments