Skip to content

FlexboxLayoutManager will throw OOM if Adapter's item count is too many. #374

Open
@eneim

Description

@eneim

Issues and steps to reproduce

FlexboxLayoutManager will throw OOM if number of item is too many. To reproduce this, simply return Integer.MAX_VALUE from Adapter.

I could see that you save a cache of Measure spec/size in an array of long whose size is depended on number of Item multiple by 2. This is the root cause, but I don't know the mindset behind the use of this Array, so I could not put any effort to fix this at the moment. Removing or Changing the use of this Array could break the FlexboxLayout too.

Expected behavior

From my investigating with other built-in LayoutManager, Integer.MAX_VALUE would not crash any of them. I expect FlexboxLayoutManager could be like this too.

Version of the flexbox library

Latest: 0.3.1

Link to code

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions