Describe the bug
A clear and concise description of what the bug is.
OpenCPN/OpenCPN#5342 (comment)
To Reproduce
haven't delved into how the plugin throttles/manages/uses virtual memory, but two things seem clear.
You need to change:
size_t AddressSpaceMonitor::GetTotalAddressSpace() const {
if (!m_isValid) {
return 0x80000000ULL; // Return default even if invalid
}
return 0x80000000ULL; // 2 GB for 32-bit process
}
In fact you shouldn't be using hard coded values at all (Probably at the time, an easy quick fix that now comes back to haunt you).
Change it to (at least for Windows, a system call to obtain the amount of virtual memory:
SYSTEM_INFO systemInfo;
GetSystemInfo(&systemInfo);
....
I can see a call to VirtualQuery, but haven't chased down a VirtualAlloc. I'm guessing you do allocate virtual memory somewhere? Must be some malloc's or new's somewhere ? In anycase, with a 64bit version of OpenCPN, you'll have 128Tb of virtual memory to play with.
Desktop (please complete the following information):
- OS: Windows
- Version [e.g. 22] Compiling 64 bit Windows OpenCPN and running WR compiled for 64 bit
Describe the bug
A clear and concise description of what the bug is.
OpenCPN/OpenCPN#5342 (comment)
To Reproduce
haven't delved into how the plugin throttles/manages/uses virtual memory, but two things seem clear.
You need to change:
size_t AddressSpaceMonitor::GetTotalAddressSpace() const {
if (!m_isValid) {
return 0x80000000ULL; // Return default even if invalid
}
return 0x80000000ULL; // 2 GB for 32-bit process
}
In fact you shouldn't be using hard coded values at all (Probably at the time, an easy quick fix that now comes back to haunt you).
Change it to (at least for Windows, a system call to obtain the amount of virtual memory:
SYSTEM_INFO systemInfo;
GetSystemInfo(&systemInfo);
....
I can see a call to VirtualQuery, but haven't chased down a VirtualAlloc. I'm guessing you do allocate virtual memory somewhere? Must be some malloc's or new's somewhere ? In anycase, with a 64bit version of OpenCPN, you'll have 128Tb of virtual memory to play with.
Desktop (please complete the following information):