Skip to content

Provide additional debug information for memory leaks via ByteBuf.touch [SPR-17427] #21960

Closed
@spring-projects-issues

Description

@spring-projects-issues

Violeta Georgieva opened SPR-17427 and commented

Hi,

Netty provides the following API

io.netty.buffer.ByteBuf.touch()


    /**
     * Records the current access location of this object for debugging purposes.
     * If this object is determined to be leaked, the information recorded by this operation will be provided to you
     * via {@link ResourceLeakDetector}.  This method is a shortcut to {@link #touch(Object) touch(null)}.
     */
    ReferenceCounted touch();

When the implementation does additional transformations of the content or buffers this object, please use this touch() functionality. If there is a memory leak, when Netty dumps the stack traces of the components that accessed this object, it will be easier to find where the buffer was leaked.

Thanks,
Violeta

 


Affects: 5.1.1

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions