Wednesday, February 14, 2007

RAM organization in Windows

RAM usage by various OS functions is measured by the following five Memory Object counters:
* Pool Nonpaged Bytes: these represent allocations directed to the nonpaged pool, which is a set virtual memory pages that always remain resident in RAM. (These are nonpageable bytes.) Device drivers and the OS use the nonpaged pool to store data structures that must stay in physical memory and can never be paged out to disk. (For example, the TCP/IP driver must allocate some amount of nonpaged memory for every TCP/IP connection that is active on the computer for data structures that are required during processing of network adaptor interrupts when page faults cannot be tolerated.)
* Pool Paged Resident Bytes: Most virtual memory pages that are acquired in the Operating System range of virtual addresses can be paged out. The Pool Paged Resident Bytes represent memory locations from the pageable pool that currently reside in RAM.
* System Cache Resident Bytes: the system’s file cache occupies a reserved range of virtual memory addresses, some of which may currently reside in RAM. (Cached file segments can also be non-resident, in which case they must be fetched from disk when they are referenced by executing processes.) System Cache Resident Bytes represents segments of the file cache that are currently resident in RAM.
* System Code Resident Bytes: memory locations associated with system code that is currently resident in RAM.
* System Driver Resident Bytes: memory locations associated with device driver code that is currently resident in RAM.

Once you know how much OS function are currently using, it ought to be a simple matter to account for RAM usage completely by factoring in the Working Set Bytes of various executing processes, as follows:
Process(_Total) Working Set Bytes = Sizeof(RAM) – (Available Bytes + Pool Nonpaged Bytes + Pool Paged Resident Bytes + System Cache Resident Bytes + System Code Resident Bytes + System Driver Resident Bytes)

Thursday, January 11, 2007

Debugging Articles

Hardware breakpoints
http://www.morearty.com/code/breakpoint/

TLS callbacks
http://hexblog.com/2005/10/tls_callbacks.html

Thanks to Michal Zigmount to let me know about them.

Wednesday, January 10, 2007

iPhone interesting but with reservations

iPhone is certainly 5 years ahead of its time as indicated by Steve Jobs in his introductory talk at CES Los Vegas.

However iPhone has a an exclusive Cingular service. Moreover the device has no buttons. It is just about impossible to dial without looking at it. There is no 3G, which will result in SLOW surfing on Internet. It uses the Apple OS X no 3rd party software(Windows mobile and Symbian has 1000+ of 3rd party software) will be compatible. However with time companies will start making OS X specific products which is a super nightmare for Microsoft folks. I dont have quantitative statistics but belive that OS X is power hungry so doubt the battery life of the phone.No GPS inside the phone with a lower Mp camera. Iphone is shipping in June, and has maximum speed EDGE 236.8 kbit/s. Thats is an 4 year old technology. Zillions of competitions will have 7200 kbit/s in June, thats 30 times faster. There is no upgrade memory slot.For enterprise customers it is Bad business phone (email sync?, any Office support at all?). No support for Skype but has Google and Yahoo search engine! Bad JAVA support I guess. So all in all revolutionary start for Apple but over hyped in my opinion.

Appple is trading $97 (+ 4.7 %). Good for share holders!

Thanks.