pub struct MemoryReport {Show 38 fields
pub vfs_files: usize,
pub vfs_text_bytes: usize,
pub vfs_line_index_bytes: usize,
pub summaries: usize,
pub summary_bytes: usize,
pub cooked_files: usize,
pub cooked_bytes: usize,
pub definitions: usize,
pub definition_bytes: usize,
pub units: usize,
pub unit_bytes: usize,
pub renderings: usize,
pub rendering_bytes: usize,
pub views: usize,
pub view_bytes: usize,
pub dead_macro_decisions: usize,
pub dead_macro_bytes: usize,
pub directive_signatures: usize,
pub include_searches: usize,
pub units_read: usize,
pub walk_cache_entries: usize,
pub walk_cache_bytes: usize,
pub walks_by_content_entries: usize,
pub walks_by_content_bytes: usize,
pub shared_timeline_bytes: usize,
pub index_names_bytes: usize,
pub index_name_postings: usize,
pub index_scope_postings: usize,
pub index_edges: usize,
pub index_edge_bytes: usize,
pub index_member_lists: usize,
pub index_member_list_bytes: usize,
pub index_memo_entries: usize,
pub index_memo_bytes: usize,
pub index_names_entries: usize,
pub prefetched: usize,
pub prefetched_bytes: usize,
pub index_scope_entries: usize,
}Expand description
The size of every table the session holds, as estimated bytes.
Fields§
§vfs_files: usizeFiles the VFS is holding the text of.
vfs_text_bytes: usizeThe bytes of those texts.
vfs_line_index_bytes: usizeThe line indexes that go with them (an offset per line, plus a byte per line).
summaries: usizeSummaries in the index, and their estimated bytes.
summary_bytes: usize§cooked_files: usizeThe cooked reading: how many files have one, and their estimated bytes.
cooked_bytes: usize§definitions: usizeEntries in MacroDefinitions, and their estimated bytes.
definition_bytes: usize§units: usizeHeld translation units, and their estimated bytes.
unit_bytes: usize§renderings: usizeThe rendering cache: entry count and the bytes of rendered text.
rendering_bytes: usize§views: usizeThe parse trees kept for reuse: how many views, and their estimated tree bytes.
The newest table here and the largest per entry — a rowan tree is 8–24× the text it describes
(docs/parser-review.md §2) — bounded by crate::cache::cache_lru::VIEW_BYTES of estimated tree. It buys
a hundredfold on every request that asks a question about a position, which used to parse the rendering again.
view_bytes: usize§dead_macro_decisions: usizeDead-macro decisions, one vector of offsets per file.
dead_macro_bytes: usize§directive_signatures: usizeDirective signatures, one per edited file.
include_searches: usizeInclude-search answers (bounded).
units_read: usizeUnit keys this session has ever read.
walk_cache_entries: usizeThe process-wide contribution table: entries and estimated bytes.
walk_cache_bytes: usize§walks_by_content_entries: usizeTimelines remembered by closure content — the dedup table, entries and estimated bytes.
Bounded in bytes (MAX_WALKS_BY_CONTENT_BYTES, 64 MB) rather than in entries: a timeline measures
0.1–6.2 MB, so a count would be a budget of anywhere between six megabytes and two gigabytes.
walks_by_content_bytes: usizeThe part of the two timeline tables that is one allocation, not two.
The unit table and the sharing cache hold the same Arc<TranslationUnit> whenever a timeline was both
held for a root and remembered for its closure’s content, which is the common case — so adding
MemoryReport::unit_bytes to MemoryReport::walks_by_content_bytes counts one allocation twice. This
field is the overlap, measured by comparing the Arc pointers rather than assumed, and the totals below
subtract it.
Measured on a 103-source project at twenty opened files: units 40.4 MB + walks 46.6 MB with every
timeline in both, so the report said 87 MB where the process held 47.
index_names_bytes: usizeThe index’s own tables — what summary_bytes and cooked_bytes are about, rather than the facts.
The inverted index (names), the include graph, and the memos that outlive a request. None of it was in this
report, and on a 103-source project the session said 112.4 MB while the process held 263 MB — a gap
that had three candidate explanations and no way to tell them apart. See
crate::index::project::ProjectIndex::table_accounting.
index_name_postings: usizePostings in the inverted index, under names and scopes — one per non-local declaration.
index_scope_postings: usizePostings under a scope.
index_edges: usizeInclude edges across the project.
index_edge_bytes: usizeThe include graph and the module map, in bytes.
index_member_lists: usizeMember lists remembered, and the bytes of what they hold.
index_member_list_bytes: usize§index_memo_entries: usizeGuard verdicts and conditional-include answers remembered.
index_memo_bytes: usize§index_names_entries: usizeDistinct names in the inverted index.
prefetched: usizeDistinct scopes in it.
The slices prepared and not yet committed — [Session::prefetched].
A table the report did not name, and the only place a summary can be held without being in the index:
commit_a_wave moves entries out as it commits them and clears the map when the queue empties, but a wave
prepares up to four times the files it will commit. On test_cpp/src/containers.cpp the pump’s own tables
reported 83–86 MB while the process grew to gigabytes and the work was finite (pending 26 → 10), so the
bytes had to be somewhere the report did not look.
prefetched_bytes: usize§index_scope_entries: usizeImplementations§
Source§impl MemoryReport
impl MemoryReport
Sourcepub fn index_table_bytes(&self) -> usize
pub fn index_table_bytes(&self) -> usize
The index’s own tables, in bytes — the part of the report that is not a file’s facts.
Sourcepub fn total(&self) -> usize
pub fn total(&self) -> usize
Everything the session’s own tables hold — the sum of the fields above, without the walk cache, which is process-wide rather than the session’s.
Counts a shared timeline once. unit_bytes and walks_by_content_bytes overlap by
MemoryReport::shared_timeline_bytes; the walk table’s half is excluded here and the unit table’s half
stays, so the sum is the bytes actually held.
Sourcepub fn total_with_the_process(&self) -> usize
pub fn total_with_the_process(&self) -> usize
The same total including the tables that are not the session’s own — the process-wide contribution table.
Trait Implementations§
Source§impl Clone for MemoryReport
impl Clone for MemoryReport
impl Copy for MemoryReport
Source§impl Debug for MemoryReport
impl Debug for MemoryReport
Source§impl Default for MemoryReport
impl Default for MemoryReport
Source§impl Display for MemoryReport
impl Display for MemoryReport
impl Eq for MemoryReport
Source§impl PartialEq for MemoryReport
impl PartialEq for MemoryReport
impl StructuralPartialEq for MemoryReport
Auto Trait Implementations§
impl Forget for MemoryReport
impl Freeze for MemoryReport
impl Move for MemoryReport
impl RefUnwindSafe for MemoryReport
impl Send for MemoryReport
impl Sync for MemoryReport
impl Unpin for MemoryReport
impl UnsafeUnpin for MemoryReport
impl UnwindSafe for MemoryReport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more