When issues arise with memefs, these troubleshooting techniques help identify and resolve problems.
Debug logging
The most powerful troubleshooting tool is WinFsp’s built-in debug logging.
Enable full debug logging
memefs -d -1 -D memefs.log -i -F NTFS -m R:
Flags explained:
-d -1: Enable all debug logs (0xFFFFFFFF)
-D memefs.log: Write logs to memefs.log file
-D -: Write logs to stderr (console)
Debug flag values
You can selectively enable logging categories:
memefs -d 0x01 -D memefs.log -m R: # Minimal logging
memefs -d 0xFF -D memefs.log -m R: # Detailed logging
memefs -d -1 -D memefs.log -m R: # All logging
Common debug flags:
0x01: Errors only
0x03: Errors and warnings
0x0F: Basic operation logging
0xFF: Detailed operation logging
-1: Everything (0xFFFFFFFF)
Reading debug logs
The debug log shows every WinFsp operation:
[timestamp] Create: FileName="\test.txt" CreateOptions=0x00000040
[timestamp] Write: Offset=0 Length=1024 BytesTransferred=1024
[timestamp] Cleanup: FileName="\test.txt" Flags=0x0001
[timestamp] Close: FileName="\test.txt"
Key information:
- Timestamp: When the operation occurred
- Operation: Which file system operation (Create, Read, Write, etc.)
- Parameters: Operation-specific details
- Results: Return codes and transferred bytes
Log file location
If not specified, logs go to stderr. For persistent logging:
memefs -d -1 -D C:\Temp\memefs.log -m R:
Debug logs can grow very large (megabytes per minute) with active file system usage. Don’t use -d -1 in production.
Common issues
Issue: “Cannot create MEMFS”
Symptoms: Service fails to start, event log shows “cannot create MEMFS”
Possible causes:
- WinFsp not installed: memefs requires WinFsp to be installed
- Insufficient permissions: Must run as Administrator
- Invalid parameters: Check CLI arguments
- Another instance running: Only one memefs instance allowed
Solutions:
# Check if WinFsp is installed
sc query WinFsp.Launcher
# Run as Administrator
runas /user:Administrator "memefs -i -F NTFS -m R:"
# Stop any existing instance
net stop memefs
Issue: “Cannot mount MEMFS”
Symptoms: File system created but mount fails
Possible causes:
- Drive letter in use: R: already assigned
- Invalid mount point: Path doesn’t exist or is invalid
- Insufficient permissions: Can’t create mount point
Solutions:
# Try a different drive letter
memefs -i -F NTFS -m S:
# Use wildcard to auto-select
memefs -i -F NTFS -m *
# Check existing drive letters
wmic logicaldisk get caption
Issue: “Cannot start MEMFS”
Symptoms: Mount succeeds but dispatcher won’t start
Possible causes:
- WinFsp driver not running: Driver stopped or disabled
- System resources exhausted: Out of memory or handles
- Antivirus interference: Security software blocking operations
Solutions:
# Check WinFsp driver status
sc query WinFsp
# Start WinFsp driver
sc start WinFsp
# Check system resources
taskmgr
# Temporarily disable antivirus
Issue: Out of memory / STATUS_DISK_FULL
Symptoms: File operations fail with “disk full” errors
Possible causes:
- Memory limit reached: Hit the
-s limit
- Actual RAM exhausted: System out of physical memory
- Address space exhausted: 32-bit process limit (rare on 64-bit)
Solutions:
# Increase memory limit
memefs -i -F NTFS -m R: -s 17179869184 # 16GB
# Check current usage
dir R:\ /s
# Free up space
del R:\large-file.dat
Monitoring memory usage:
# PowerShell: Check free space
Get-PSDrive R | Select-Object Used,Free
Symptoms: Operations slower than expected
Possible causes:
- Memory pressure: System swapping to disk
- Debug logging enabled:
-d -1 slows operations significantly
- Antivirus scanning: Real-time scanning of RAM disk
- Too many small files: Map lookups for large directories
Solutions:
# Disable debug logging
memefs -i -F NTFS -m R: # No -d flag
# Exclude from antivirus
# Add R:\ to exclusion list in antivirus settings
# Check system memory
taskmgr # Look at memory usage and paging
# Organize files into subdirectories
Issue: File/directory access denied
Symptoms: Can’t read, write, or delete files
Possible causes:
- Security descriptor issues: Incorrect ACLs
- File in use: Another process has the file open
- Root SDDL too restrictive:
-S parameter too strict
Solutions:
# Use permissive root SDDL
memefs -i -F NTFS -m R: -S "O:BAG:BAD:P(A;;FA;;;SY)(A;;FA;;;BA)(A;;FA;;;WD)"
# Grant full access to Everyone (WD)
# SY = SYSTEM, BA = Administrators, WD = Everyone
# Check file security
icacls R:\file.txt
# Close all handles to a file
handle.exe R:\file.txt /accepteula
Issue: UNC path not accessible
Symptoms: Network share \\Server\Share can’t be accessed
Possible causes:
- Incorrect UNC prefix: Must use single backslash in
-u parameter
- Network discovery disabled: Windows firewall blocking
- Authentication issues: Credentials required
Solutions:
# Correct UNC syntax
memefs -i -F NTFS -u "\Server\Share" -m *
# Check network discovery
Get-NetFirewallRule -DisplayGroup "Network Discovery" | Enable-NetFirewallRule
# Access the share
net use * \\Server\Share
Issue: Volume label won’t change
Symptoms: -l parameter ignored or label reverts
Possible causes:
- Label too long: Maximum 32 characters
- Invalid characters: Some characters not allowed
- Cache issues: Explorer caching old label
Solutions:
# Use shorter label
memefs -i -F NTFS -m R: -l "RAMDISK"
# Refresh Explorer
# Press F5 in Windows Explorer
# Check label
vol R:
Error codes
memefs returns Windows NTSTATUS error codes. Common ones:
STATUS_SUCCESS (0x00000000)
Operation succeeded normally.
STATUS_UNSUCCESSFUL (0xC0000001)
Generic failure. Check debug log for details.
STATUS_NOT_IMPLEMENTED (0xC0000002)
Operation not supported. Shouldn’t occur with memefs.
STATUS_INVALID_PARAMETER (0xC000000D)
Invalid parameter passed to operation. Check CLI arguments.
STATUS_NO_SUCH_FILE (0xC000000F)
File not found.
STATUS_END_OF_FILE (0xC0000011)
Attempted to read past end of file.
STATUS_DISK_FULL (0xC000007F)
No space available. Hit memory limit.
STATUS_OBJECT_NAME_COLLISION (0xC0000035)
File already exists when it shouldn’t.
STATUS_ACCESS_DENIED (0xC0000022)
Permission denied. Check security descriptors.
STATUS_DIRECTORY_NOT_EMPTY (0xC0000101)
Can’t delete directory because it contains files.
Event log
Windows Event Log contains memefs service messages.
Viewing event log
# PowerShell: View memefs events
Get-EventLog -LogName Application -Source memefs -Newest 20
Event types:
- Information: Normal startup/shutdown messages (main.cpp:171-178)
- Warning: Non-critical issues (main.cpp:27)
- Error: Failures like “cannot create MEMFS” (main.cpp:28)
Common event log messages
Startup message (Information):
memefs -s 8589934592 -u \Server\Share -m R: -l RAMDISK
Shows how memefs was started with which parameters.
Failure message (Error):
cannot create MEMFS
cannot mount MEMFS
cannot start MEMFS
Indicates where in the startup process the failure occurred.
Diagnostic checklist
When troubleshooting, check:
- WinFsp installed:
sc query WinFsp
- Running as Administrator: Required for service operations
- Drive letter available: Not already in use
- Sufficient RAM: Check Task Manager
- No other instance: Only one memefs allowed
- Valid parameters: Check CLI syntax
- Event log: Look for error messages
- Debug log: Enable with
-d -1 -D memefs.log
- Antivirus: May interfere with operations
- Windows version: Ensure compatibility
Advanced debugging
Using Process Monitor
Process Monitor shows all file system activity:
- Download and run procmon.exe
- Filter for “Path begins with R:”
- Perform the failing operation
- Review the operation sequence
Look for:
- ACCESS_DENIED: Permission issues
- NAME_NOT_FOUND: File not found
- END_OF_FILE: Read past EOF
- BUFFER_OVERFLOW: Buffer too small
Using WinDbg
For crashes or hangs, attach WinDbg:
# Find memefs process ID
tasklist | findstr memefs
# Attach debugger
windbg -p <PID>
Useful WinDbg commands:
k: Stack trace
!analyze -v: Analyze crash
lm: List modules
~*k: All thread stacks
Memory leak detection
If memory usage grows unexpectedly:
# Enable debug logging
memefs -d -1 -D memefs.log -m R:
# Perform operations
# ...
# Check allocated sectors
# Look at process memory in Task Manager
Memory should stabilize or decrease after file deletion. Constantly growing memory indicates a leak (should not occur with modern C++ memefs).
Getting help
If issues persist:
- Check GitHub issues: WinFsp-MemFs-Extended issues
- Review WinFsp docs: winfsp.dev
- Collect debug logs: Use
-d -1 -D memefs.log
- Note system info: Windows version, RAM, memefs version
- Create minimal reproduction: Simplest command that fails
When reporting issues, include:
- Exact command line used
- Error messages from event log
- Debug log excerpt (if relevant)
- System specifications
- Steps to reproduce