| Previous | Next |
| kIOReturnError | kIOReturnNoResources |
kIOReturnNoMemory
Memory can mean more than heap allocation
kIOReturnNoMemory identifies an unsuccessful memory allocation in the IOKit operation. In an I/O path, the missing resource may be needed to prepare a memory descriptor, create a mapping, build a scatter/gather representation, or allocate driver-side state. It is not limited to an application’s ordinary heap allocation.
IOKit transfer preparation can require buffers to be resident in physical memory and wired for the duration of the request. That makes the size, segmentation, lifetime, and timing of the request important. The related kIOReturnNoResources is broader; this value specifically points to an allocation failure, so increasing queue depth or blindly resubmitting the same request can make pressure worse.
Useful evidence
- Record the request size, number of segments, direction, allocation stage, and number of outstanding transfers.
- Check whether memory descriptors, mappings, and completion objects are released on every completion and cancellation path.
- Test a smaller or serialized request to separate a fixed allocation limit from cumulative pressure.
- Avoid allocation while holding a command-gate or other lock when the surrounding IOKit API can block.
References
- Apple XNU source: IOReturn.h
- Apple: Managing data in IOKit
- Apple: Introduction to IOKit Fundamentals
Looking for a different code? Search another status or error code.