SiddiqSoft.WinProcessInfo
2.5.2
See the version list below for details.
dotnet add package SiddiqSoft.WinProcessInfo --version 2.5.2
NuGet\Install-Package SiddiqSoft.WinProcessInfo -Version 2.5.2
<PackageReference Include="SiddiqSoft.WinProcessInfo" Version="2.5.2" />
<PackageVersion Include="SiddiqSoft.WinProcessInfo" Version="2.5.2" />
<PackageReference Include="SiddiqSoft.WinProcessInfo" />
paket add SiddiqSoft.WinProcessInfo --version 2.5.2
#r "nuget: SiddiqSoft.WinProcessInfo, 2.5.2"
#:package SiddiqSoft.WinProcessInfo@2.5.2
#addin nuget:?package=SiddiqSoft.WinProcessInfo&version=2.5.2
#tool nuget:?package=SiddiqSoft.WinProcessInfo&version=2.5.2
ProcessInfo : Cross-Platform Process Information
Overview
A header-only C++23 library providing cross-platform process information with minimal footprint. Captures CPU, memory, and system details for the current process.
Features:
- Minimal footprint - header-only library
- Cross-platform support (Windows, Linux, macOS, Unix)
- JSON serialization via
nlohmann::json std::formatsupport for easy output- Single ownership semantics
Quick Start
Installation
<details> <summary><b>CMake with CPM (Recommended)</b></summary>
CPMAddPackage("gh:SiddiqSoft/GenProcessInfo#main") // replace main with specific version
target_link_libraries(${PROJECT_NAME} INTERFACE GenProcessInfo::GenProcessInfo)
</details>
<details> <summary><b>NuGet (Windows)</b></summary>
Install-Package SiddiqSoft.WinProcessInfo
</details>
<details> <summary><b>Manual</b></summary>
Copy include/siddiqsoft/GenProcessInfo.hpp to your project.
</details>
Basic Usage
#include "siddiqsoft/GenProcessInfo.hpp"
int main() {
siddiqsoft::GenProcessInfo procInfo;
// Basic info available immediately
std::cout << "Process ID: " << procInfo.processId << "\n";
std::cout << "CPU Cores: " << procInfo.cpuCores << "\n";
// Expensive operation - call sparingly
procInfo.snapshot();
std::cout << "Memory: " << procInfo.memWorkingSet << " KB\n";
std::cout << "Threads: " << procInfo.cpuThreads << "\n";
return 0;
}
<details> <summary><b>JSON Output Example</b></summary>
#include <format>
#include "nlohmann/json.hpp"
#include "siddiqsoft/GenProcessInfo.hpp"
int main() {
siddiqsoft::GenProcessInfo procInfo;
procInfo.snapshot();
nlohmann::json j = procInfo;
std::cout << j.dump(2) << "\n";
return 0;
}
</details>
Requirements
- C++23 or later (MSVC 2022+, GCC 13+, Clang 17+)
- Windows 7+, Linux (with /proc), macOS 10.5+, or POSIX-compliant systems
- Optional:
nlohmann::jsonfor JSON serialization
Platform Support
| Platform | Status | Notes |
|---|---|---|
| Windows | ✓ Full | Windows 7 and later |
| Linux | ✓ Full | Requires /proc filesystem |
| macOS | ⚠ Limited | Thread count limited (requires Mach APIs) |
| Unix | ⚠ Limited | Generic POSIX fallback |
API Reference
See API.md for comprehensive documentation including:
- All public members and methods
- Detailed parameter descriptions
- Platform-specific behavior
- Performance considerations
- Complete usage examples
- Thread safety notes
Key Methods
| Method | Description | Cost |
|---|---|---|
snapshot() |
Capture memory, handles, and thread count | Expensive |
uptime() |
Get elapsed time since object creation | Cheap |
getCurrentProcessId() |
Get current process ID (static) | Cheap |
Key Members
| Member | Type | Description |
|---|---|---|
processId |
unsigned long |
Current process ID |
cpuCores |
unsigned long |
Available CPU cores |
cpuThreads |
unsigned long |
Process thread count |
cpuHandles |
unsigned long |
Open handles/file descriptors |
memWorkingSet |
size_t |
Current memory in KB |
memPeakWorkingSet |
size_t |
Peak memory in KB |
memPrivate |
size_t |
Private memory in KB |
nameHostname |
std::string |
DNS hostname |
nameFqdn |
std::string |
Fully qualified domain name |
See API.md for complete member documentation.
<details> <summary><b>Performance Tips</b></summary>
- Reuse instances - Create once, call
snapshot()periodically - Background thread - Call
snapshot()in a low-priority background thread - Cache results - Store values if frequent access is needed
- Avoid copies - Copy/move operations are deleted (single ownership) </details>
<details> <summary><b>Backward Compatibility</b></summary>
The library provides WinProcessInfo as an alias for GenProcessInfo:
siddiqsoft::WinProcessInfo procInfo; // Legacy name still works
</details>
<details> <summary><b>License</b></summary>
BSD 3-Clause License - See LICENSE file </details>
<small align="right">
© 2021 Siddiq Software LLC. All rights reserved.
</small>
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| native | native is compatible. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.5.8 | 0 | 5/21/2026 |
| 2.5.7 | 0 | 5/21/2026 |
| 2.5.5 | 61 | 5/19/2026 |
| 2.5.3 | 101 | 5/7/2026 |
| 2.5.2 | 93 | 5/7/2026 |
| 2.5.1 | 98 | 5/7/2026 |
| 2.5.0 | 94 | 5/7/2026 |
| 2.3.0 | 93 | 5/7/2026 |
| 2.2.0 | 90 | 5/6/2026 |
| 1.0.6 | 931 | 12/15/2021 |
| 1.0.5 | 968 | 11/20/2021 |
| 1.0.4 | 773 | 7/30/2021 |
| 1.0.3 | 757 | 7/30/2021 |
| 1.0.2 | 751 | 7/30/2021 |
| 1.0.1 | 764 | 7/30/2021 |
Major change to the API. See documentation https://github.com/SiddiqSoft/GenProcessInfo/blob/main/README.md