At 21:50 +0100 11/3/03, joe udder wrote: Hello. I am a little curious on how virtual memory per process works in Darwin. I am calling "task_info()" using TASK_BASIC_INFO to retrieve the amount of memory my process is using, but I receive very doubtful numbers. According to a webpage[1], the values are number of pages, but to me they look very much like the size in bytes instead. I came to this conclusion using the "top" and comparing the values for resident memory sizes. I suspect it is merely a typo in the headerfiles? However, the real confusion is "virtual_size", which is a value around 700MB while "top" shows ~90MB. And that one I can't understand at all. Anyone has an idea on how this works? Both sizes are in bytes. You're right and the documentation is wrong. Please file a bug. <http://developer.apple.com/bugreporter/> With regards to "top", it subtracts two values (SHARED_TEXT_REGION_SIZE and SHARED_DATA_REGION_SIZE, both which have the value 0x10000000) from each tasks virtual size to account for the shared memory submap that's incorporated into every process. For more information, you can look at the source [APSL account required]. Both "top" and task_info are in Darwin. <http://www.opensource.apple.com/cgi-bin/registered/cvs/system_cmds/top.tproj/top.c?rev=1.1.1.5&content-type=text/x-cvsweb-markup> <http://www.opensource.apple.com/cgi-bin/registered/cvs/xnu/osfmk/kern/task.c?rev=1.1.1.5&content-type=text/x-cvsweb-markup> S+E -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Technical Support * Networking, Communications, Hardware _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Quinn