material-components / material-components/material-components-android

[ BottomNavigationView] The BottomNavigationView component takes up too much memory!

Open
#4,243 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Needs Investigation Widget: BottomNavigation
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:**
image
image

**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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.