@@ -22,24 +22,49 @@ export function getMemorySegments(stats: TMemoryStats): MemorySegment[] {
2222 key : 'SharedCacheConsumption' ,
2323 value : getMaybeNumber ( stats . SharedCacheConsumption ) ,
2424 capacity : getMaybeNumber ( stats . SharedCacheLimit ) ,
25+ isInfo : false ,
2526 } ,
2627 {
2728 label : i18n ( 'text_query-execution' ) ,
2829 key : 'QueryExecutionConsumption' ,
2930 value : getMaybeNumber ( stats . QueryExecutionConsumption ) ,
3031 capacity : getMaybeNumber ( stats . QueryExecutionLimit ) ,
32+ isInfo : false ,
3133 } ,
3234 {
3335 label : i18n ( 'text_memtable' ) ,
3436 key : 'MemTableConsumption' ,
3537 value : getMaybeNumber ( stats . MemTableConsumption ) ,
3638 capacity : getMaybeNumber ( stats . MemTableLimit ) ,
39+ isInfo : false ,
3740 } ,
3841 {
3942 label : i18n ( 'text_allocator-caches' ) ,
4043 key : 'AllocatorCachesMemory' ,
4144 value : getMaybeNumber ( stats . AllocatorCachesMemory ) ,
45+ isInfo : false ,
4246 } ,
47+ ] ;
48+
49+ const nonInfoSegments = segments . filter (
50+ ( segment ) => segment . value !== undefined ,
51+ ) as MemorySegment [ ] ;
52+ const sumNonInfoSegments = nonInfoSegments . reduce ( ( acc , segment ) => acc + segment . value , 0 ) ;
53+
54+ const totalMemory = getMaybeNumber ( stats . AnonRss ) ;
55+
56+ if ( totalMemory ) {
57+ const otherMemory = Math . max ( 0 , totalMemory - sumNonInfoSegments ) ;
58+
59+ segments . push ( {
60+ label : i18n ( 'text_other' ) ,
61+ key : 'Other' ,
62+ value : otherMemory ,
63+ isInfo : false ,
64+ } ) ;
65+ }
66+
67+ segments . push (
4368 {
4469 label : i18n ( 'text_external-consumption' ) ,
4570 key : 'ExternalConsumption' ,
@@ -58,7 +83,7 @@ export function getMemorySegments(stats: TMemoryStats): MemorySegment[] {
5883 value : getMaybeNumber ( stats . HardLimit ) ,
5984 isInfo : true ,
6085 } ,
61- ] ;
86+ ) ;
6287
6388 return segments . filter ( ( segment ) => segment . value !== undefined ) as MemorySegment [ ] ;
6489}
0 commit comments