当前位置: 首页>>代码示例>>Java>>正文


Java OS.pageSize方法代码示例

本文整理汇总了Java中net.openhft.chronicle.core.OS.pageSize方法的典型用法代码示例。如果您正苦于以下问题:Java OS.pageSize方法的具体用法?Java OS.pageSize怎么用?Java OS.pageSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.openhft.chronicle.core.OS的用法示例。


在下文中一共展示了OS.pageSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: tryHashLookupSlotSize

import net.openhft.chronicle.core.OS; //导入方法依赖的package包/类
private long tryHashLookupSlotSize(int hashLookupSlotSize) {
    long entriesPerSegment = findMaxEntriesPerSegmentToFitHashLookupSlotSize(
            hashLookupSlotSize);
    long entrySpaceSize = roundUp(entriesPerSegment * entrySizeInfo().averageEntrySize);
    // Not to lose too much on linux because of "poor distribution" entry over-allocation.
    // This condition should likely filter cases when we target very small hash lookup
    // size + entry size is small.
    // * 5 => segment will lose not more than 20% of memory, 10% on average
    if (entrySpaceSize < OS.pageSize() * 5L)
        return -1;
    return trySegments(entriesPerSegment, MAX_SEGMENTS);
}
 
开发者ID:OpenHFT,项目名称:Chronicle-Map,代码行数:13,代码来源:ChronicleMapBuilder.java

示例2: segmentHeaderSize

import net.openhft.chronicle.core.OS; //导入方法依赖的package包/类
int segmentHeaderSize() {
    int segments = actualSegments();

    long pageSize = OS.pageSize();
    if (segments * (64 * 3) < (2 * pageSize)) // i. e. <= 42 segments, if page size is 4K
        return 64 * 3; // cache line per header, plus one CL to the left, plus one to the right

    if (segments * (64 * 2) < (3 * pageSize)) // i. e. <= 96 segments, if page size is 4K
        return 64 * 2;

    // reduce false sharing unless we have a lot of segments.
    return segments <= 16 * 1024 ? 64 : 32;
}
 
开发者ID:OpenHFT,项目名称:Chronicle-Map,代码行数:14,代码来源:ChronicleMapBuilder.java

示例3: computeNumberOfTiersInBulk

import net.openhft.chronicle.core.OS; //导入方法依赖的package包/类
private long computeNumberOfTiersInBulk() {
    // TODO review heuristics
    int tiersInBulk = actualSegments / 8;
    tiersInBulk = Maths.nextPower2(tiersInBulk, 1);
    while (computeTierBulkBytesSize(tiersInBulk) < OS.pageSize()) {
        tiersInBulk *= 2;
    }
    return tiersInBulk;
}
 
开发者ID:OpenHFT,项目名称:Chronicle-Map,代码行数:10,代码来源:VanillaChronicleHash.java

示例4: msync

import net.openhft.chronicle.core.OS; //导入方法依赖的package包/类
private void msync(long address, long length) throws IOException {
    // address should be a multiple of page size
    if (OS.pageAlign(address) != address) {
        long oldAddress = address;
        address = OS.pageAlign(address) - OS.pageSize();
        length += oldAddress - address;
    }
    if (OS.isWindows()) {
        WindowsMsync.msync(raf, address, length);
    } else {
        PosixMsync.msync(address, length);
    }
}
 
开发者ID:OpenHFT,项目名称:Chronicle-Map,代码行数:14,代码来源:VanillaChronicleHash.java


注:本文中的net.openhft.chronicle.core.OS.pageSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。