Skip to content

Commit 8dae65e

Browse files
authored
Merge pull request #1769 from volatilityfoundation/inodepages/memory_usage
Linux pagecache.Files: Memory Usage
2 parents df03d22 + d29be5c commit 8dae65e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

volatility3/framework/plugins/linux/mountinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def get_superblocks(
281281

282282
if sb_ptr in seen_sb_ptr:
283283
continue
284-
seen_sb_ptr.add(sb_ptr)
284+
seen_sb_ptr.add(int(sb_ptr))
285285

286286
superblock = sb_ptr.dereference()
287287

volatility3/framework/plugins/linux/pagecache.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,14 @@ def get_inodes(
283283
continue
284284

285285
# Inode already processed?
286+
# Store a primitive int (instead of the pointer value) to track
287+
# addresses we've already seen. Storing the full `objects.Pointer`
288+
# uses too much memory, and we don't need all of the information
289+
# that it contains.
286290
if root_inode_ptr in seen_inodes:
287291
continue
288-
seen_inodes.add(root_inode_ptr)
292+
293+
seen_inodes.add(int(root_inode_ptr))
289294

290295
root_path = mountpoint
291296

@@ -318,9 +323,13 @@ def get_inodes(
318323
continue
319324

320325
# Inode already processed?
326+
# Store a primitive int (instead of the pointer value) to track
327+
# addresses we've already seen. Storing the full `objects.Pointer`
328+
# uses too much memory, and we don't need all of the information
329+
# that it contains.
321330
if file_inode_ptr in seen_inodes:
322331
continue
323-
seen_inodes.add(file_inode_ptr)
332+
seen_inodes.add(int(file_inode_ptr))
324333

325334
if follow_symlinks:
326335
file_path = cls._follow_symlink(file_inode_ptr, file_path)

0 commit comments

Comments
 (0)