Skip to content

ProcessBackgroundActions and max cache sizes tuning questions #260

@lano1106

Description

@lano1106

Hi,

  1. is the thread calling tcmalloc::MallocExtension::ProcessBackgroundActions()
    must be detached, or joinable?

If joinable is ok, can you do the following at program teardown:

  tcmalloc::MallocExtension::SetBackgroundProcessActionsEnabled(false);
  bkgThread.join();

by quickly scanning MallocExtension_Internal_ProcessBackgroundActions(), I have concluded that it was doing more than just release memory...

is this correct?
because I am planning keep BackgroundReleaseRate to its zero default value to avoid generating madvise() system calls...

  1. tcmalloc::MallocExtension::SetBackgroundProcessSleepInterval()

default value is 1 second.

What is the reasonable range for that parameter?

1 second - 1 hour ?

What are the tradeoffs of a long interval vs short interval?

I had in mind 30 seconds for my app.

Does the background housekeeping tasks induce lock contention to the threads using the allocator?

  1. Which stats to look at to determine that increasing the max cache sizes could have a positive effect?

overflows / underflows ratio?
anything else?

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

    Issue actions