Skip to content

bthread::Mutex的内存占用远大于std::mutex #1190

@GOGOYAO

Description

@GOGOYAO

Describe the bug (描述bug)
std::vectorbthread::Mutex locks_(1000000)
std::vectorstd::mutex locks_(1000000)
top查看,前者占用 VIRT:212M,RES:84612;后者占用 VIRT:66624,RES:7120

这个内存使用的差距有点大(RES是10倍关系)哦,简单看了下源码,感觉应该没有那么大差距才对?

To Reproduce (复现方法)
随意写个main函数就可以了

Expected behavior (期望行为)
差距没有量级的差距

Versions (各种版本)
OS: centos7
Compiler: gcc 8
brpc: master (11da9c8)
protobuf: 3.11

Additional context/screenshots (更多上下文/截图)

Metadata

Metadata

Assignees

No one assigned

    Labels

    usageuser need to change the way using brpc to solve the problem

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions