A comprehensive C++ system stress testing tool that performs simultaneous CPU and memory stress testing with real-time monitoring and colorized console output.
- Multi-threaded CPU stress testing with hash-intensive operations
- Memory stress testing with configurable allocation targets
- Real-time progress monitoring with visual progress bars
- Cross-platform support (Windows and Unix-like systems)
- Colorized console output for better visibility
- Automatic CPU core detection and utilization
- Thread-safe operations with proper synchronization
The tool displays real-time progress with:
- Time progress bar showing test duration
- Memory allocation progress with current usage
- Hash operations counter
- Colorized status messages
- C++17 compatible compiler (or C++20 for GUI)
- just command runner
- curl, tar (for fetching/building external dependencies if not present in system packages)
- Threading support (pthread on Unix, native threads on Windows)
- Windows: Visual Studio 2017+ or MinGW-w64
- Linux/macOS: GCC 7+ or Clang 5+
This project uses just as a command runner.
-
Clone the repository:
git clone <repository-url> cd SysPulse
-
Build and run the console app:
just build just run
-
Build and run unit tests:
just test-build just test -
Build and run the GUI:
just gui-build just gui
(Note: just automatically checks system packages for slint-compiler and gtest using which. If not found, it automatically fetches and builds them in the libs/ directory).
The program will:
- Display a warning about system stress testing
- Prompt for confirmation to continue
- Detect available CPU cores
- Run stress tests for 30 seconds (configurable)
- Display real-time progress and metrics
- Show final test results
Key parameters can be modified in include/MemoryStressTest.hpp for memory :
static constexpr int MULTIPLIER = 2; // Memory multiplier for stress test (resulting in a 2 GB Max Allocation)
static constexpr int TEST_DURATION = 30; // seconds
static constexpr size_t TARGET_MEMORY = 1024 * 1024 * 1024; // 1 GB
// Memory bandwidth measurement constants
static constexpr size_t BANDWIDTH_TEST_SIZE = 64 * 1024 * 1024; // 64MB test buffer
static constexpr int BANDWIDTH_ITERATIONS = 5; // Number of iterations for averaging
the icons are present because I use eza project set it up if you want them too
$ eza --color=always --group-directories-first --links -a --tree --ignore-glob="*.log|*.tmp|.git|profiling|build"
.
├── flamegraphs
│ ├── calls_flamegraph.svg
│ ├── cpu_flamegraph.svg
│ └── memory_flamegraph.svg
├── include
│ ├── ConsoleColors.hpp
│ ├── ConsoleInitializer.hpp
│ ├── CPUStressTest.hpp
│ ├── LinkedList.hpp
│ ├── MemoryStressTest.hpp
│ └── TimeManager.hpp
├── Scripts
│ ├── kernel_security_bypass.sh
│ └── profile.sh
├── src
│ ├── ConsoleInitializer.cpp
│ ├── CPUStressTest.cpp
│ ├── main.cpp
│ ├── main_gui.cpp
│ ├── MemoryStressTest.cpp
│ └── TimeManager.cpp
├── tests
│ ├── test_cpustresstest.cpp
│ ├── test_linkedlist.cpp
│ ├── test_memorystresstest.cpp
│ └── test_timemanager.cpp
├── ui
│ ├── colors.slint
│ ├── main.slint
│ ├── metric_card.slint
│ ├── panel.slint
│ └── thread_bar.slint
├── .gitattributes
├── .gitignore
├── Doxyfile
├── justfile
├── LICENSE
├── README.md
└── shell.nix- Uses compute-intensive hash-like operations
- Spawns one thread per CPU core
- Performs batched operations for efficiency
- Uses atomic counters for thread-safe operation tracking
- Allocates memory in 1MB blocks
- Uses custom linked list for memory management
- Employs RAII principles with smart pointers
- Handles allocation failures gracefully
| Library | Purpose |
|---|---|
<iostream> |
Console I/O operations |
<mutex> |
Thread synchronization |
<vector> |
Dynamic memory containers |
<thread> |
Multi-threading support |
<chrono> |
Time measurement |
<atomic> |
Thread-safe variables |
- Windows: Uses Windows API for console initialization and UTF-8 support
- Unix-like systems: Uses ANSI escape sequences for colors and formatting
- Thread management: Uses C++11 standard threading library
- Memory allocation limits to prevent system crashes
- Graceful error handling for allocation failures
- Thread-safe console output with mutex protection
- Controlled test duration to prevent indefinite stress
The tool tracks and displays:
- Hash operations per second: Measures CPU performance
- Memory allocation rate: Tracks memory subsystem performance
- Real-time progress: Visual feedback during testing
- Resource utilization: Shows CPU cores and memory usage
-
Build fails on Windows:
- Ensure you have Visual Studio Build Tools installed
- Use Developer Command Prompt for VS
-
Colors not displaying:
- On Windows, ensure you're using Windows 10 version 1607 or later
- Try running from Windows Terminal instead of cmd.exe
-
Memory allocation errors:
- Reduce the
MULTIPLIERvalue in the header file - Ensure sufficient system memory is available
- Reduce the
- High memory usage: This is intentional for stress testing
- CPU temperature: Monitor system temperature during extended use
- System responsiveness: Close other applications for accurate testing
- Fork the repository
- Create a feature branch
- Make your changes
- Ensure code follows the existing style
- Add appropriate comments and documentation
- Test on multiple platforms if possible
- Submit a pull request
This project is open source. Please refer to the license file for details.
- Built with modern C++17 features
- Uses standard library threading and atomic operations
- Inspired by system benchmarking and stress testing tools
Warning: This tool is designed to stress your system. Use responsibly and monitor system temperature and stability during testing.