Re: JavaSysMon bug?

45 views
Skip to first unread message

Jez Humble

unread,
Aug 30, 2010, 1:07:12 PM8/30/10
to Dmitry Davidenko, javas...@googlegroups.com
(cced javasysmon group)

Hey Dmitry

Thanks for the bug report - I've created an issue in the GitHub issue tracker.

Fixing the c is trivial - I'll need to get access to some Windows boxen to recompile the dlls. Meanwhile, keep an eye on the issue.

Thanks,

Jez.

2010/8/30 Dmitry Davidenko <di...@developmentontheedge.com>
    Hello!

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.
   
JNIEXPORT jobject JNICALL Java_com_jezhumble_javasysmon_WindowsMonitor_swap (JNIEnv *env, jobject obj)
{...  
(jlong) (pagesize * 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.
 
    SY, GolemXIV



--
Jez Humble
Reply all
Reply to author
Forward
0 new messages