You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
works incorrectly under Windows, it returns the amount of used virtual memory, not free. It's very easy to test - just load or unload some applications and check the result.
JNIEXPORT jobject JNICALL Java_com_jezhumble_javasysmon_WindowsMonitor_swap (JNIEnv *env, jobject obj)
{...
(jlong) (pagesize * perfinfo.CommitTotal), // should be (perfinfo.CommitLimit - perfinfo.CommitTotal)
(jlong) (pagesize * perfinfo.CommitLimit));...
}
CommitTotal
The number of pages currently committed by the system. Note that committing pages (using VirtualAlloc with MEM_COMMIT) changes this value immediately; however, the physical memory is not charged until the pages are accessed.
CommitLimit
The current maximum number of pages that can be committed by the system without extending the paging file(s). This number can change if memory is added or deleted, or if pagefiles have grown, shrunk, or been added. If the paging file can be extended, this is a soft limit.
The text was updated successfully, but these errors were encountered:
new JavaSysMon.swap().getFreeBytes()
works incorrectly under Windows, it returns the amount of used virtual memory, not free. It's very easy to test - just load or unload some applications and check the result.
http://github.com/jezhumble/javasysmon/blob/master/src/main/c/windows/javasysmon.c
JNIEXPORT jobject JNICALL Java_com_jezhumble_javasysmon_WindowsMonitor_swap (JNIEnv *env, jobject obj)
{...
(jlong) (pagesize * perfinfo.CommitTotal), // should be (perfinfo.CommitLimit - perfinfo.CommitTotal)
(jlong) (pagesize * perfinfo.CommitLimit));...
}
CommitTotal
The number of pages currently committed by the system. Note that committing pages (using VirtualAlloc with MEM_COMMIT) changes this value immediately; however, the physical memory is not charged until the pages are accessed.
CommitLimit
The current maximum number of pages that can be committed by the system without extending the paging file(s). This number can change if memory is added or deleted, or if pagefiles have grown, shrunk, or been added. If the paging file can be extended, this is a soft limit.
The text was updated successfully, but these errors were encountered: