[SERVER-84014] FlatBSON lookup map memory usage does not increase Created: 08/Dec/23  Updated: 08/Dec/23  Resolved: 08/Dec/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Shin Yee Tan Assignee: Shin Yee Tan
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

When traversing the map to add up the memory usage of individual entries, stringHeapUsage returns 0 so the memory approximation doesn't accurately track usage.



 Comments   
Comment by Shin Yee Tan [ 08/Dec/23 ]

The stringHeapUsage accounts for small string optimizations and the memory usage for small strings should already be accounted for in the sizeof slot_type. The memory calculation might not change by a single additional entry because the memory approximation accounts for the map's capacity and what is already allocated to the structure rather than just its size.

Generated at Thu Feb 08 06:53:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.