Skip to content

Service re-registration leads to increasingly large allocs #896

Closed
coredevices/mynewt-nimble
#6

Description

@jimmo

hi! I'm from the MicroPython project. We provide a Python API around NimBLE, but we've run into a problem due to the fact that the Python program can be restarted without the board restarting. We do what we can (via the public API) to shutdown and reset NimBLE across these "program resets" but I've just noticed an issue that during service registration we see increasingly large calls to malloc() from ble_gatts_count_cfg().

The cause is that although we call gatts_reset(), nothing resets ble_hs_max_services ble_hs_max_attrs and ble_hs_max_client_configs. I am currently working around this by resetting them from our code.

I think the feature we really want is a global "nimble_reset" function that clears/resets all global variables (i.e. zeros .bss variables and resets .data variables back to default values, as if the board has just restarted).

I understand this is a bit of a weird requirement -- not many implementors of NimBLE would need to register services more than once per hard reset, but would appreciate any suggestions. Thanks!

Activity

  1. ghost added a commit that references this issue on Dec 22, 2020
  2. ghost added a commit that references this issue on Dec 22, 2020
  3. ghost added a commit that references this issue on Jan 26, 2021
  4. ghost added a commit that references this issue on Jan 26, 2021
  5. ghost added a commit that references this issue on Jan 26, 2021
  6. ghost added a commit that references this issue on Jan 26, 2021
  7. ghost added a commit that references this issue on Jan 27, 2021
  8. ghost added a commit that references this issue on Jan 27, 2021
  9. ghost added a commit that references this issue on Jan 29, 2021
  10. ghost added a commit that references this issue on Jan 31, 2021
  11. ghost added a commit that references this issue on Feb 1, 2021
  12. ghost added a commit that references this issue on Feb 1, 2021
  13. ghost added a commit that references this issue on Feb 15, 2021
  14. ghost added a commit that references this issue on Feb 15, 2021
  15. ghost added a commit that references this issue on Mar 10, 2021
  16. ghost added a commit that references this issue on Mar 10, 2021
  17. ghost added a commit that references this issue on Mar 10, 2021
  18. ghost added a commit that references this issue on Apr 9, 2021
  19. ghost added a commit that references this issue on Apr 18, 2021
  20. ghost
    self-assigned this
    on May 27, 2021
  21. ghost added a commit that references this issue on May 23, 2026
  22. ghost closed this as completedin #2294on Sep 9, 2026
  23. ghost added a commit that references this issue on Sep 9, 2026
    af4baa4
  24. ghost added a commit that references this issue on Sep 10, 2026
    9ed683d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions