Class PageSizeUtil


  • public final class PageSizeUtil
    extends Object
    Utility for accessing the system page size.
    • Field Detail

      • PAGE_SIZE_UNKNOWN

        public static final int PAGE_SIZE_UNKNOWN
        Value indicating an unknown page size.
        See Also:
        Constant Field Values
      • DEFAULT_PAGE_SIZE

        public static final int DEFAULT_PAGE_SIZE
        The default page size on most systems.
        See Also:
        Constant Field Values
      • CONSERVATIVE_PAGE_SIZE_MULTIPLE

        public static final int CONSERVATIVE_PAGE_SIZE_MULTIPLE
        A conservative fallback value (64 KiBytes) that should be a multiple of the page size even in some uncommon cases of servers installations with larger-than-usual page sizes.
        See Also:
        Constant Field Values
    • Method Detail

      • getSystemPageSize

        public static int getSystemPageSize()
        Tries to get the system page size. If the page size cannot be determined, this returns -1.

        This internally relies on the presence of "unsafe" and the resolution via some Netty utilities.

      • getSystemPageSizeOrDefault

        public static int getSystemPageSizeOrDefault()
        Tries to get the system page size. If the page size cannot be determined, this returns the DEFAULT_PAGE_SIZE.
      • getSystemPageSizeOrConservativeMultiple

        public static int getSystemPageSizeOrConservativeMultiple()
        Tries to get the system page size. If the page size cannot be determined, this returns the CONSERVATIVE_PAGE_SIZE_MULTIPLE.