How much RAM does OH Use For You?

2.2.0-SNAPSHOT build 1081 running on an Ubuntu 16.04 server.

  1. 5872352
  2. 145
  3. 660
  4. 4453
1 Like

using docker image openhab:2.2.0-snapshot-amd64 from https://hub.docker.com/r/openhab/openhab/
oracle jvm 1.8.0_152
on synology

  1. roundabout 500-600 mb
  2. 126 active bundles
  3. 374 items
  4. 3159 lines (including comments & cr)
1 Like

(Pi3, openHABian 1.3, latest snapshot)

  1. 582536 KB, ~422000 resident
  2. 129 bundles
  3. 585 items
  4. 4901 lines of rules
1 Like

Vsz (Virtual SiZe) is not what you want. That is simply the amount of address space that has been mapped - not used, not allocated, just declared as having some permissions and (optionally) backing store. In the case of a java process vsz is the space used for the jvm, your jars, jvm overhead and… the jvm heap, I.e. your Xmx value. So vsz of a java process is simply a reflection of the jvm used and Xmx value, which, unless you’ve specifically set it is simply a reflection of how much memory your machine has.

RSS is closer to what you want. That’s the amount of memory that is currently resident, i.e. has physical pages allocated. It’s not perfect - if you are short of memory some wanted pages may have already been paged out, if you have plenty of memory you probably have all kinds of initialization stuff in RAM that will never again be touched - but it’s closer, especially if you pay attention to paging stats as well.

RSS immediately after start up and min/max RSS from some period of actual usage are generally what you need to know in order to avoid having to trade performance for lack of (or even too much) memory. Assuming that you’re not already in that space and just haven’t realized it yet…

It should be the same and not all containers will retain ps in the image. A container is kind of like a need generation chroot. All the containers are using the same Linux kernel running the host and since the kennel does process management the result of running ps should be largely the same with the exception that when run from the host ps can see all the processes and within the container it is only allowed to see the processes running in that container.

If you look at my not you will see that is aware of what vsz represents. For my purposes the amount of virtual memory is adequate for my purposes. I just want to get a feel for the amount of memory involved and to see some differences, in particular, differences in docker versus running on the host versus running on a board computer. I’m not trying to profile it not am I trying to figure out whether these deployments will run on the banana pi. I’m just after a thumb in the air.

Ubuntu 16.04

4 blank lines
(I could not figure out how to get the result, I do not know Linux.)

0

ssh -p 8101 openhab@localhost 'bundle:list | grep  Active |wc -l'

125

0

ssh -p 8101 openhab@localhost 'smarthome:items list | grep  .* |wc -l'

252

  1. 1400

PS I understand that without the first point, my information is useless, but someone can help with the decision on the second and third points.

1 Like

Raspberry Pi 3 Model B running Openhabian with openHAB 2.1.0-1

130992
136 Active bundles
322 Items
2091 lines

Not sure about the first number, since my output for the ps command looked like this:
130992

470788

1 Like

See the reply to opus above.

0 bundles is definitely not right. There are dozens of bundles required just to get the core of ESH/OH running. What happens if you remove the grep?

125 sounds better. Not sure why -c didn’t work for you.

On the contrary, it is quite useful indeed. The cheese memory itself really isn’t all that useful, but it is giving me a feel for some of the differences in how oh consumes memory on the different platforms. It really isn’t a good measure of how much memory is actually being used by oh, just how much OH could ask for if it needed it.

What you you did with the WC gives me the numbers I need.

Running OH2.1 STABLE on a RPi3 with Raspbian Jessie (not openHABian):

  1. 494248
  2. 153 active bundles
  3. 840 items
  4. 900 total lines in rules
1 Like

What helped me on question 1 was the extra “-” to start with:

ps -eo…

1 Like

Yes, it worked! I apologize, I did not carefully read the previous posts, I realized that you solved the problem, but did not understand how :frowning: (I do not know English)

Now here is my data:
2.2.0-SNAPSHOT build 1082 running on an Ubuntu 16.04

  1. 3633644
  2. 125
  3. 252
  4. 1400
1 Like

I used ps -eo vsz,command | grep openhab | grep -v grep | cut -d ' ' -f 1

productive OH2 (openHAB 2.1.0-1 (Release Build)) on Raspberry Pi 2 Model B Rev 1.1

  1. 130596KB and 501148KB - I have two lines here
  2. 112 Active Bundles
  3. 752 items
  4. 1407 rules

second test & half-productive OH2 (openHAB 2.1.0-1 (Release Build)) on Raspberry Pi 3 Model B Rev 1.2

  1. 124664 and 509484
  2. 116 Active Bundles
  3. 30 items
  4. 90 rules

external productive OH2 (openHAB 2.1.0-1 (Release Build)) on Raspberry Pi Model B Rev 2

  1. 317448 nur eine Zahl hier
  2. 113
  3. 172
  4. 19
1 Like

Running the first command I get two lines:
122564
474868

The first one is frontail and the second is Java running openhab.
As for the others
135 active bundles
246 items
814 lines of code in rules

1 Like

Raspberry Pi 3 Model B Rev 1.2 running Raspbian Jessie

  1. 471420 kB
  2. 109 Active bundles
  3. 664 Items
  4. 1094 Lines
1 Like

I’m happy to help out. However:

Returns nothing.

Returns 4317888.

After logging on to Karaf:

Returns “0”.

Returns the full list. It seems I have 125 active bundles.

Returns also “0”.

Returns the full list. I have 673 items.

Returns “2236”.

Probably all due to the fact I run OH 2.2 in chroot on a Synology environment.

Summary:

  1. 4317888 RAM
  2. 125 active bundles
  3. 673 items
  4. 2236 rules
1 Like

Raspberry Pi 3 Model B running Raspbian

  1. 501428
  2. 125
  3. 332
  4. 655

Kevin

1 Like

That sounds reasonable based on what everyone else is reporting.

I don’t understand why -c works for some users and not others.

Thanks for posting!

Operating System Raspbian GNU/Linux 9
Java Version Zulu Embedded 8.20.0.42-linux-aarch32hf (build 1.8.0_121-b42)
openHAB Version 2.2.0-SNAPSHOT (#1077)
Memory 532060 kB
Active Bundles 122
Items 80
Lines of rule script . 212
1 Like

ok, thanks much for your help
here we go:
1: 2782400
2: 136 active bundles
3: 213 items
4: 372 lines of rules

1 Like

Raspberry Pi 3 Model B
Raspbian GNU/Linux 8
2.2.0-SNAPSHOT Build #1078

1: 477528 KB
2: 132 bundles
3: 647 items
4: 2375 lines of rules

1 Like