Re: ps returning mem values with minus
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com serenity:~ toxygen$ ps -o %mem,command,pid | head -n4 %MEM PID COMMAND -0.1 7431 -bash -0.1 7581 -bash -0.1 7698 /usr/libexec/gdb/gdb-i386-apple-darwin I'm using default 10.4.11 kernel: xnu-792.25.20~1/RELEASE_I386 -- Terry _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... On Mar 24, 2010, at 5:12 AM, Marian Such wrote: Hello, I've gotten to very obscure situation when ps is returning %mem values with minus in front of them. E.g.: serenity:~ toxygen$ ps auxww | head -n5 USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND toxygen 7550 6.0 -2.4 493404 50724 ?? S 12:35PM 2:13.78 /Applications/iTunes.app/Contents/MacOS/iTunes -psn_0_10092545 windowse 6302 3.6 -4.4 972504 92536 ?? Rs 2:18PM 16:16.41 /System/Library/Frameworks/ApplicationServices.framework/ Frameworks/CoreGraphics.framework/Resources/WindowServer -daemon toxygen 7428 2.5 -1.2 443500 25876 ?? R 11:49AM 0:25.90 /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal -psn_0_9306113 toxygen 7559 0.2 -1.2 396376 24816 ?? S 12:42PM 0:30.95 /Applications/Editors/Aquamacs Emacs.app/Contents/MacOS/ Aquamacs Emacs -psn_0_10223617 It has never happened before, so I would appreciate any ideas about this. cpu is core 2 duo and 2gb of ram is installed. The value returned into the integer mempages by the "hw.physmem" sysctl value in the "ps" program itself has gone negative because you have more than 8TB of memory installed (you don't), all of your tasks_info.resident_size have become similarly corrupt (unlikely), you are using your own "ps" program or "libc" library (more likely). Is this an Intel system or a PPC, and if it's Intel, is this running "ps" as a PPC binary? If so, then we are probably talking about bit endienness confusion in the sysctl() implementation in Rosetta, and if so, this is not something that was intended to work. Note that if you are popen'ing the ps program from a program where you've selected "run under Rosetta" in the Finder in order to force the program to run as a PPC binary, it will preferentially cause child subprograms to also run under Rosetta. The theory is that this would allow starting a subtask that talked to the main task using endiend dependent means, such as shared memory, data structures in files, or privately defined Mach messages. If this is testing for a commercial product intended to run under both PPC and i386, you should either use the "arch" command on the command line, or thin the binary, rather than checking the checkbox in the Finder, in order to avoid this "affinity" behaviour. On a real PPC, this will just work as intended, while on an Inte you should be running the Intel binary preferentially. This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert