{"record":{"id":"1d1fe57122a1646d","repo":"aeron-io/aeron","slug":"page-size-less-than-min-size-of-page-min-size-page-size","errorCode":null,"errorMessage":"Page size less than min size of {PAGE_MIN_SIZE}: page size={pageSize}","messagePattern":"Page size less than min size of (.+?): page size=(.+?)","errorType":"validation","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"aeron-client/src/main/java/io/aeron/logbuffer/LogBufferDescriptor.java","lineNumber":482,"sourceCode":"        }\n\n        if (!BitUtil.isPowerOfTwo(termLength))\n        {\n            throw new IllegalStateException(\"Term length not a power of 2: length=\" + termLength);\n        }\n    }\n\n    /**\n     * Check that page size is valid and alignment is valid.\n     *\n     * @param pageSize to be checked.\n     * @throws IllegalStateException if the size is not as expected.\n     */\n    public static void checkPageSize(final int pageSize)\n    {\n        if (pageSize < PAGE_MIN_SIZE)\n        {\n            throw new IllegalStateException(\n                \"Page size less than min size of \" + PAGE_MIN_SIZE + \": page size=\" + pageSize);\n        }\n\n        if (pageSize > PAGE_MAX_SIZE)\n        {\n            throw new IllegalStateException(\n                \"Page size more than max size of \" + PAGE_MAX_SIZE + \": page size=\" + pageSize);\n        }\n\n        if (!BitUtil.isPowerOfTwo(pageSize))\n        {\n            throw new IllegalStateException(\"Page size not a power of 2: page size=\" + pageSize);\n        }\n    }\n\n    /**\n     * Get the value of the initial Term id used for this log.\n     *","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-client/src/main/java/io/aeron/logbuffer/LogBufferDescriptor.java#L464-L500","documentation":"LogBufferDescriptor.checkPageSize validates the file page size used for log buffers. This error means the supplied pageSize is smaller than PAGE_MIN_SIZE (4096 bytes), below what the OS mapping and Aeron's log layout assume. It is thrown as IllegalStateException during log buffer creation or when configuring the driver/media context.","triggerScenarios":"Setting filePageSize (Aeron.Context or media driver context) to a value below 4096, e.g. file-page-size=1024, or passing a small page size directly to checkPageSize/log buffer factory code.","commonSituations":"Trying to reduce memory footprint by shrinking page size, misreading page-size units (bytes vs KB), or copying driver config tuned for another system.","solutions":["Set filePageSize to at least 4096 (PAGE_MIN_SIZE), e.g. context.filePageSize(4096)","Use the common default of 4096 or a larger power of two (e.g. 65536) if file I/O granularity warrants it","Validate configured page size against LogBufferDescriptor.PAGE_MIN_SIZE at startup"],"exampleFix":"// before\nctx.filePageSize(1024);\n// after\nctx.filePageSize(4096); // >= LogBufferDescriptor.PAGE_MIN_SIZE","handlingStrategy":"validation","validationCode":"if (pageSize < LogBufferDescriptor.PAGE_MIN_SIZE) { pageSize = LogBufferDescriptor.PAGE_MIN_SIZE; }","typeGuard":null,"tryCatchPattern":"try { driver = MediaDriver.launch(ctx); } catch (final IllegalStateException ex) { if (ex.getMessage().contains(\"Page size less than min\")) { ctx.filePageSize(LogBufferDescriptor.PAGE_MIN_SIZE); driver = MediaDriver.launch(ctx); } else throw ex; }","preventionTips":["Always configure page size in bytes, never KB/MB, and comment units","Clamp to PAGE_MIN_SIZE at config load","Use Aeron defaults unless profiling shows otherwise"],"tags":["aeron","configuration","page-size","validation"],"backgroundTag":"value-out-of-range","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}