| 20 Apr 2025 |
K900 | That's not how it works | 15:55:19 |
K900 | Unused RAM is wasted RAM | 15:55:25 |
Andrew | no, free RAM is wasted RAM | 15:57:38 |
Andrew | available RAM is what I need to compile stuff and what not. | 15:58:19 |
Andrew | If it will stay idle on 85%, then I won't be able to do anything. | 15:58:42 |
Andrew | After I opened Firefox and it peaked at 14.1, I then opened Element and it died with permanent flashbang instead of UI, so I had to restart the client. | 15:59:41 |
Andrew | total used free shared buff/cache available
Mem: 15Gi 14Gi 158Mi 1.1Gi 2.2Gi 895Mi
Swap: 0B 0B 0B
| 16:00:14 |
Andrew | Yeah, I don't wanna open a Rust project with 1 GiB to spare... | 16:01:20 |
Andrew | Download images.zip | 16:06:01 |
Andrew | Now I can see everything, since there is no swap:
59Mi 60197 fs/btrfs/inode.c:7694 [btrfs] func:btrfs_alloc_inode
70Mi 17882 drivers/iommu/dma-iommu.c:920 func:__iommu_dma_alloc_pages
84Mi 21252 arch/x86/mm/pgtable.c:44 func:pte_alloc_one
94Mi 4242 mm/slub.c:2425 func:alloc_slab_page
117Mi 29803 fs/btrfs/extent_io.c:631 [btrfs] func:btrfs_alloc_page_array
149Mi 38113 mm/memory.c:1062 func:folio_prealloc
392Mi 100167 fs/btrfs/compression.c:477 [btrfs] func:add_ra_bio_pages
699Mi 57225 mm/slub.c:2423 func:alloc_slab_page
1.2Gi 2790 drivers/gpu/drm/ttm/ttm_pool.c:97 [ttm] func:ttm_pool_alloc_page
1.5Gi 392553 mm/readahead.c:186 func:ractl_alloc_folio
1.8Gi 450592 mm/memory.c:1060 func:folio_prealloc
8.4Gi 2188492 mm/swap_state.c:476 func:__read_swap_cache_async
| 16:06:20 |
K900 | That's not really how it works | 16:06:38 |
Andrew | and yet... swap state uses 8.4 GiB? what? | 16:06:42 |
Andrew | at this point I just don't know anything | 16:07:01 |
K900 | /proc/allocinfo doesn't track used memory | 16:07:06 |
K900 | It tracks allocations | 16:07:10 |
K900 | So whenever any memory is allocated, it will be tracked | 16:07:19 |
K900 | It doesn't matter if it's backed by physical RAM or swap or anything else | 16:07:33 |
Andrew | so... are tracked allocations never get erased? | 16:07:47 |
K900 | And what it's backed by will change over time | 16:07:40 |
K900 | No, they can be deallocated | 16:07:56 |
K900 | But that file does not track "RAM" or "swap" | 16:08:26 |
K900 | It tracks virtual memory, effectively | 16:08:33 |
Andrew | No, I mean stuff from /proc/allocinfo doesn't get erased? | 16:09:19 |
K900 | It does | 16:09:32 |
Andrew | why it says swap state is so high if there is no swap now? will it ever stop showing it? | 16:09:53 |
Andrew | * why it says swap state is so high if there is no swap now? will it ever stop showing swap state allocations? | 16:10:03 |
Andrew | does it track with a delay or something? | 16:10:39 |
K900 | No | 16:10:41 |
K900 | When you disable a swap device, the pages stored on it don't go poof | 16:11:05 |
K900 | They get moved to RAM | 16:11:07 |