material-components / material-components/material-components-android
[ BottomNavigationView] The BottomNavigationView component takes up too much memory!
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Description:** After the component was declared in XML and referenced the menu, the memory increased by about 25-35MB! When I deleted the menu declaration, the memory returned to normal. also I checked the size of the menu icon and it is only a few dozen KB.
**Expected behavior:**
**Source code:**
```
```
```
```
**Minimal sample app repro:** https://github.com/crowforkotlin/Issues-BottomNavigationView
**Android API version:** 34
**Material Library version:** 1.12.0
**Device:** Xiaomi、Pixel6 API23
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked minimal sample app and the XML containing BottomNavigationView with app:menu, then compare memory usage with and without main_container_bottom_menu on Android API 34 and the reported library version. Trace the menu inflation and component setup to identify where the additional allocation occurs. Done means a reproducible cause, a scoped fix or confirmed upstream behavior, and regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100