Skip to main content
This guide covers common issues you may encounter when using Memory Monitor and how to resolve them.

Common Errors

Problem

Memory Monitor cannot read certain process information from /proc/[pid]/status due to insufficient permissions.
PermissionError: [Errno 13] Permission denied: '/proc/1234/status'

Why It Happens

The Linux kernel restricts access to process information for security reasons. Processes owned by other users (especially root) cannot be read without elevated privileges.Memory Monitor is designed to silently skip processes it cannot access, so you’ll still get results for processes you have permission to read.

Solutions

For most users: No action needed. Memory Monitor will analyze all processes you have permission to read and still identify the highest memory consumer among them.
If you need complete system visibility:
# Run with sudo to access all processes
sudo python3 main.py
Only use sudo if you need to monitor system processes or processes owned by other users. For monitoring your own applications, regular permissions are sufficient.

Code Behavior

Memory Monitor handles this gracefully in process_analyzer.py:25-26:
except PermissionError:
    continue  # Skip processes we can't access

Problem

A process terminated between when Memory Monitor listed it and when it tried to read its status file.
FileNotFoundError: [Errno 2] No such file or directory: '/proc/5678/status'

Why It Happens

Processes can start and stop rapidly on a busy system. The /proc/[pid]/ directory disappears immediately when a process exits.Memory Monitor handles this automatically by skipping terminated processes.

Solution

No action required. This is normal behavior and handled gracefully by the code in process_analyzer.py:23-24:
except FileNotFoundError:
    continue  # Process terminated, skip it
If you see this error displayed (which shouldn’t happen with the current code), it means the exception handling is working correctly. The tool will continue scanning other processes.

Problem

Memory Monitor runs but shows no memory statistics or shows zeros for all values.

Possible Causes

1. Running on non-Linux systemMemory Monitor requires Linux’s /proc filesystem and will not work on:
  • Windows
  • macOS
  • BSD systems (without Linux compatibility layer)
Memory Monitor is designed exclusively for Linux systems. It reads from /proc/meminfo and /proc/[pid]/status, which are Linux-specific kernel interfaces.
Solution: Run Memory Monitor on a Linux machine or use a Linux VM/container.2. /proc filesystem not mountedIn rare cases (containers, chroots), /proc may not be mounted.Check if /proc is available:
ls /proc/meminfo
If missing, mount it:
sudo mount -t proc proc /proc
3. No processes are readableIf running in a restricted environment where all processes are owned by other users, you may need elevated permissions (see PermissionError section above).

Problem

Unexpected I/O errors when accessing /proc filesystem.

Possible Causes

  • Corrupted or unusual /proc filesystem state
  • Running in a container with restricted access
  • System under extreme load or out of memory

Solutions

  1. Verify /proc is accessible:
    cat /proc/meminfo
    
  2. Check system resources:
    df -h
    free -h
    
  3. Restart in a clean environment:
    • Exit and restart your terminal
    • If in a container, restart the container
  4. Check system logs:
    sudo dmesg | tail -50
    
    Look for kernel errors related to memory or processes.

Platform Compatibility

Linux Only: Memory Monitor requires a Linux operating system with a standard /proc filesystem.

Supported

  • Ubuntu / Debian
  • Red Hat / CentOS / Fedora
  • Arch Linux
  • Alpine Linux (in containers)
  • Any Linux distribution with /proc filesystem

Not Supported

  • Windows (no /proc filesystem)
  • macOS (uses different process information system)
  • BSD systems (use different /proc structure)

Running in Containers

Memory Monitor works in Docker and other containers, but:
Container considerations:
  • You’ll only see processes running inside the container
  • Memory statistics reflect the container’s view (may be limited by cgroups)
  • Some containers run as non-root and may have limited /proc access
To see host processes, you need to run on the host system, not in a container.

Python Version Issues

Type Hint Compatibility

The code uses modern Python type hints including:
def InformationMemory() -> str | None:
def ListDirectory() -> tuple[str, int] | None:
Minimum Python version: 3.10+The | union syntax and lowercase generic types (list, tuple) require Python 3.10 or later.

If You See Type Errors

TypeError: unsupported operand type(s) for |: 'type' and 'type'
or
TypeError: 'type' object is not subscriptable
Solution:
  1. Check your Python version:
    python3 --version
    
  2. Upgrade to Python 3.10 or later:
    # Ubuntu/Debian
    sudo apt update
    sudo apt install python3.10
    
    # Fedora
    sudo dnf install python3.10
    
  3. Or modify the code for older Python: Replace type hints with compatible syntax:
     from typing import Optional, List
     
     def InformationMemory() -> Optional[str]:
     def ListDirectory() -> Optional[List[str]]:
    

Installation Issues

Problem

ModuleNotFoundError: No module named 'memory_info'

Solution

Ensure all files are in the same directory:
ls -l
# Should show:
# main.py
# memory_info.py
# process_analyzer.py
Run from the directory containing the files:
cd /path/to/memory-monitor
python3 main.py

Problem

bash: python3: command not found

Solution

Install Python 3:
# Ubuntu/Debian
sudo apt update
sudo apt install python3

# Fedora
sudo dnf install python3

# Arch
sudo pacman -S python

Unexpected Output Issues

Problem

Memoria Total: 0 kB
Memoria Libre: 0 kB
Buffers: 0 kB
Cached: 0 kB
Memoria Usada: 0 kB

Diagnosis

Check if /proc/meminfo is readable:
cat /proc/meminfo | head -10

Solutions

  • Ensure you’re on a Linux system
  • Verify /proc is mounted (see “No output appears” above)
  • Check file permissions on /proc/meminfo

Problem

El proceso con mayor VmRSS es
 Name: systemd
 PID: 1
 VmRSS: 0 kB

Why It Happens

This can occur when:
  1. No processes have VmRSS information available
  2. All readable processes terminated during the scan
  3. All processes you can access have no resident memory (very unlikely)

Solution

Run with sudo to ensure you can read process information:
sudo python3 main.py

Getting Help

Still having issues?
  1. Verify your environment:
    • Confirm you’re on Linux: uname -s (should output “Linux”)
    • Check Python version: python3 --version (should be 3.10+)
    • Test /proc access: cat /proc/meminfo
  2. Check system logs:
    sudo dmesg | tail -50
    journalctl -xe | tail -50
    
  3. Run with verbose output: Add debug print statements to see where the issue occurs

Next Steps

Build docs developers (and LLMs) love