Skip to content

MappedFile 中 MappedByteBuffer 和 TransientStorePool 中的ByteBuffer的区别 #2466

@BenXiangYangGuang

Description

@BenXiangYangGuang

您好,正在学习 RocketMQ 源码,有几个问题请教一下:

MappedByteBuffer 和 ByteBuffer 都是堆外内存(直接内存);
image

引入 TransientStorePool 的目的是什么呢?或者他和 MappedByteBuffer 有那里更高效的地方。
ByteBuffer 有内存锁定功能,还有其他区别吗?

然后MappedByteBuffer、ByteBuffer 的数据落盘和数据查询,和 PageCache 有是什么关系,ByteBuffer 数据落盘的时候,还用经过 PageCahe 吗?

谢谢!

Activity

duhenglucky

duhenglucky commented on Dec 4, 2020

@duhenglucky
Contributor

@BenXiangYangGuang TransientStorePool 相当于在内存层面做了读写分离,写走内存吃,读走pagecache,同时最大程度消除了page cache的锁竞争,降低了毛刺,咨询类的这种问题建议走邮件列表:),这样能够沉淀下来哈。

BenXiangYangGuang

BenXiangYangGuang commented on Dec 9, 2020

@BenXiangYangGuang
Author

ok,已订阅,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @duhenglucky@BenXiangYangGuang

        Issue actions

          MappedFile 中 MappedByteBuffer 和 TransientStorePool 中的ByteBuffer的区别 · Issue #2466 · apache/rocketmq