Skip to content

NO_CACHE failed to execute example program ntfsdir #2

@winapiadmin

Description

@winapiadmin

Thanks for trying my project. Yes, using FULL_CACHE when declaring NtfsVolume will kill your memory (it takes about 25Go on my computer). Try use NO_CACHE.

You can also reduce MEMORY_BUFFER_SIZE in file-reader.cpp. It will take more time to read but cache will store less unused data.

Originally posted by @bansan85 in #1

diff:

diff --git a/NTFSLibTests/ntfsdir/main.cpp b/NTFSLibTests/ntfsdir/main.cpp
index f6d1e36..0ccc39e 100644
--- a/NTFSLibTests/ntfsdir/main.cpp
+++ b/NTFSLibTests/ntfsdir/main.cpp
@@ -214,7 +214,7 @@ int main(int argc, char* argv[])
     return -1;
   }

-  NtfsVolume<Strategy::FULL_CACHE> volume(volname);
+  NtfsVolume<Strategy::NO_CACHE> volume(volname);
   if (!volume.IsVolumeOK())
   {
     printf("Cannot get NTFS BPB from boot sector of volume %c\n", volname);

Behavior:

PS C:\Users\winapiadmin\source\repos\filelookup\build> _deps\ntfs-build\NTFSLibTests\ntfsdir\NtfsDir.exe c:
2026-02-18  13:37       <DIR>           < H >   $GetCurrent
2026-02-27  10:29       <DIR>           < HS>   $Recycle.Bin
2025-08-02  09:00                0      < H >   $WINRE_BACKUP_PARTITION.MARKER
Files: 1, Directories: 2

Expected behavior:

PS C:\Users\winapiadmin\source\repos\filelookup\build> .\_deps\ntfs-build\NTFSLibTests\ntfsdir\NtfsDir.exe c:
2026-02-18  13:37       <DIR>           < H >   $GetCurrent
2026-02-27  10:29       <DIR>           < HS>   $Recycle.Bin
2025-08-02  09:00                0      < H >   $WINRE_BACKUP_PARTITION.MARKER
2026-03-27  15:11                0      <   >   1203.tmp
2026-01-04  15:17                1024   < H >   AMTAG.BIN
2026-01-27  06:18                112496 <   >   appverifUI.dll
2025-08-02  08:44                112    < HS>   bootTel.dat
2026-03-15  21:27                0      <   >   C1DB.tmp
2025-07-26  05:56       <DIR>           < HS>   Documents and Settings
2026-04-06  23:06                12288  < HS>   DumpStack.log.tmp
2026-04-02  15:05                0      <   >   EC76.tmp
2025-09-22  21:31       <DIR>           <   >   inetpub
2025-12-22  13:44       <DIR>           <RH >   MSOCache
2026-01-04  16:09       <DIR>           <   >   OneDriveTemp
2026-04-07  18:03                3110928384     < HS>   pagefile.sys
2026-04-06  22:56       <DIR>           <   >   PerfLogs
2025-12-19  21:51       <DIR>           <   >   Program Files
2026-04-02  20:53       <DIR>           <R  >   Program Files (x86)
2026-04-05  15:40       <DIR>           < H >   ProgramData
2025-09-24  12:15       <DIR>           < HS>   Recovery
2026-04-06  23:06                16777216       < HS>   swapfile.sys
2026-04-06  12:30       <DIR>           < HS>   System Volume Information
2026-03-04  11:28       <DIR>           <   >   tools
2025-11-29  20:18       <DIR>           <R  >   Users
2025-12-29  20:59       <DIR>           <   >   usr
2026-01-27  06:18                68120  <   >   vfcompat.dll
2026-04-06  22:29       <DIR>           <   >   Windows
2025-10-16  19:45       <DIR>           <   >   XboxGames
Files: 11, Directories: 17

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions