From: hyperguy <sig...@hy...> - 2009-08-19 22:31:45
|
First, it's great that there is an open source project like this - thanks! However, a few comments, and then my questions. The javadocs are ok, but not that useful. I end up going to the examples or src to see how the APIs work in practice, but while useful, there still is missing information. Some things that I would like to see are: 1) more comments in the examples 2) add code snippets to javadocs (like some of the java libraries) 3) a user guide. there was some comments about this in the forums, but it seems this never got off the ground, unless I'm missing something. :-) I have the feeling that I am only scratching the surface of what sigar can do, and I'm not sure if I am doing things right or not. e.g. do I use one sigar object all the time? Or create a new one each time? Stuff like that. Anyways, I would like to monitor memory usage for processes that I am creating in Java. Through trial and error, I've noticed that in some cases, even when a process has died, the information can be retrieved by using the old PID, for example, using ProcCpu and ProcState. I've also noticed that the info doesn't automatically update, but rather you have to call the same API again to get updated. This turned out to be really useful since all I have to do is wait for the process to end and then collect the data I'm interested in (and/or collect data at the beginning of the process). When I use ProcMem, this turns out to be different. Calling ProcMem when the process no longer exists results in an error. How would I go about monitoring memory using ProcMem? One way would be to use a busy loop and check the process memory periodically, but I may miss some important information, or impact performance too greatly and end up skewing the numbers that I really want to measure. Ideally, I would like to get some information like procexp.exe on windows (especially cpu and memory info), but in a cross-platform way (linux, mac os, solaris, etc). Is this possible? I would like to use the same metrics on all platforms. On windows for memory, we are particularly interested in working set and peakworkingset sizes, but we may change metrics if they are truly cross-platform metrics. I'm not really sure why we want these two metrics, but historically we've collected them on windows only. But we can change that for cross-platform compatibility of metrics. Our home-grown test framework collects these metrics as it runs our tests where it invokes other programs and monitors them while they are running. Also, are the 3 memory metrics all that are available? i.e. resident, size (vm), and pagefaults? Thanks a lot! Hyper |