这是indexloc提供的服务,不要输入任何密码
Skip to content

Measures to use less RAM by default #3875

@joerg1985

Description

@joerg1985

I assume a significant amount of openHAB instances are running on single board computers.
These have usually a limited set of memory especially the Raspberry Pi 3 based.

For me openHAB 4.0.x runs successfully with some modifications on a Raspi 3a+ (512 MB).
I would like to share these to upstream these changes / find some other improvements.

  1. Set -Dxtext.qn.interning=true or call QualifiedNameInterning#enable() to intern the strings inside the QualifiedName instances.
    This will remove a lot of Strings (~50%) from memory and could be exposed to the UI and the default setting could be enabled.

  2. Disable Use IPv6 in Network Settings of openHAB to get rid of a second jmDNS instance.
    This might be a good default value for most users?

  3. Set -Xss1024k, this will half the thread stack size from the 2048k default
    This is a more advanced topic but could be documented somewhere.
    openHAB is using 200+ threads and this has quite an impact

  4. Set -XX:+UseG1GC and -XX:+UseStringDeduplication to enable string deduplication on GC level

Do you think memory usage is an issue at all or are most of the users currently running a SBC with 2+gb RAM?
Are there further tips and tricks to improve the memory consumption?

Your Environment

  • Version used: openHAB 4.0.x
  • Environment name and version: Raspi 3a+
  • Operating System and version: Raspbian Bookworm

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAn enhancement or new feature of the Core

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions