Skip to content

Add modules API for active memory defragmentation #4185

@oranagra

Description

@oranagra

With current code, if anyone will enable active memory defragmentation on a server with modules who have their own data types, it can cause an overload of CPU.
The defragger will detect a fragmentation problem, and will consume a lot of CPU cycles to try and fix it, but will be unable to do so, and will continue to burn CPU cycles.

what should be done is allow modules with data types to implement callback for defragmentation work.
this should be very similar to the DEBUG DIGEST mechanism we have today.
Redis will call a module's callback for each key, and the module will iterate on it's data structure, calling redis defrag function on each pointer.
then, if the defrag function returns a non-null value, the module has to replace the pointer in it's data structures, and do any necessary adjustments on the data in the new pointer (without accessing the old pointer which was already released).

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