Skip to content

Buffered Result Sets over-allocating memory #244

Description

@caleblloyd

Originally reported at PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#262

      SELECT `m`.`Id`
      FROM `Blogs` AS `m`
      LIMIT 1000

Here are the actual allocations by ArrayPool.Shared.Rent/Return:

bufferDataLengths: Wanted 1 Got 16
bufferedDataOffsets: Wanted 1 Got 16
bufferedPayload: Wanted 16384 Got 16384
bufferDataLengths: Wanted 1 Got 16
bufferedDataOffsets: Wanted 1 Got 16
bufferedPayload: Wanted 16384 Got 16384
bufferDataLengths: Wanted 1 Got 16
bufferedDataOffsets: Wanted 1 Got 16
bufferedPayload: Wanted 16384 Got 16384

bufferedPayload must span multiple MySQL rows, need to re-work buffering. ArrayPool.Shared.Rent/Return may be overkill here as it seems to like to allocate a power of 2, we should probably switch this to allocating the correct sized objects.

No activity

Activity on this issue will appear here.

Activity

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions