---
title: getPageCounts
framework: kernel
role: symbol
role_heading: Instance Method
path: kernel/iomemorydescriptor/1441992-getpagecounts
---

# getPageCounts

Retrieve the number of resident and/or dirty pages encompassed by a memory descriptor.

## Declaration

```occ
IOReturn getPageCounts(IOByteCount *residentPageCount, IOByteCount *dirtyPageCount);
```

## Parameters

- `residentPageCount`: - If non-null, a pointer to a byte count that will return the number of resident pages encompassed by this IOMemoryDescriptor.
- `dirtyPageCount`: - If non-null, a pointer to a byte count that will return the number of dirty pages encompassed by this IOMemoryDescriptor.

## Return Value

Return Value An IOReturn code.

## Discussion

Discussion This method returns the number of resident and/or dirty pages encompassed by an IOMemoryDescriptor.

## See Also

### Getting the Memory Pages

- [getPageCounts](kernel/iomemorydescriptor/1812787-getpagecounts.md)
- [getPhysicalAddress](kernel/iomemorydescriptor/1812795-getphysicaladdress.md)
- [getPhysicalAddress](kernel/iomemorydescriptor/1441916-getphysicaladdress.md)
- [getPhysicalSegment](kernel/iomemorydescriptor/1812807-getphysicalsegment.md)
- [getPhysicalSegment](kernel/iomemorydescriptor/1442068-getphysicalsegment.md)
