Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memory full #81

Open
dieandgo opened this issue Jan 5, 2019 · 4 comments
Open

memory full #81

dieandgo opened this issue Jan 5, 2019 · 4 comments
Milestone

Comments

@dieandgo
Copy link

dieandgo commented Jan 5, 2019

hi all, i am new in all of this, i install temperature-machine and works great, but after a day aproximately sensor stop read and i have to disconnect raspberry to fix it.
i see that memory becames full each time before crash. I made htop and i see temperature-machine process is occupying all memory, i restart it and start again until filling memory.
what can be the problem?

@tobyweston
Copy link
Owner

tobyweston commented Jan 13, 2019

Can you be more specific? Temperature-machine is unlikely to "crash" as such (quit unexpectedly) and as it runs as a service, it will attempt to restart if it were to.

It's more likely that the network disconnected, so when you say the sensor stopped reading, what did you observe exactly? Could you connect to the website? The sensor readings disappeared on the UI? How many machines are you running? Can you share the logs on each machine?

I'm not sure how to read htop but Java (which runs the temperature-machine) may allocate more memory than it needs and manage it. It may be that you're seeing what looks like a lot of memory being used but if you don't see "out of memory" in the logs, it's unlikely to actually be running out of memory.

My htop looks like this:

image

... and regular top:

image

@dieandgo
Copy link
Author

hi. i have 1 sensor in 1 raspberry.
my htop looks like yours. with more "java" items.
this items uses a lot of memory.
if i restart temperature-machine process it start from 300M. increassing until 500M. after some time in 500. finally sensor stop reading. it doesnt appear on temperature machine or home assistant like sensor.

if i restart raspberry sensor doesnt begin. if i disconnect raspberry from power. it returns to work.

i tried to stop process and memory stay at 200M. and sensor doesnt stop working anymore.

i have not many experience on this. sorry :S

@tobyweston
Copy link
Owner

tobyweston commented Jan 13, 2019

As I say, Java allocates all that memory although doesn't use it. It shouldn't affect other processes or indeed temperature-machine. I think its a red herring 🐟.

Can you share the logs under ~/.tempeature?

ps. the htop output with lots of processes are actually child processes. Using top may give a clearer idea of how much memory is being used, mine showed 35%.

@tobyweston
Copy link
Owner

tobyweston commented Aug 30, 2019

Looking at this again, I'm not sure setting the initial memory and max memory so high makes sense. Running free -h seems to show it uses a lot of memory so I may have been wrong before and it may be "hogging" memory.

They're set as 256mb and 512mb respectively (the logic of the later being the max memory available on the lowest spec Pi).

Running the Java defaults, leaves more headroom on the box and TM doesn't seem to need much more than 50mb.

Java Default (pi zero)

Screenshot 2019-08-30 at 12 15 17

Screenshot 2019-08-30 at 12 18 02

Current temperature-machine Default (pi zero)

Screenshot 2019-08-30 at 12 19 22

I'll run my setup with the Java (lower) defaults for a bit. If there's no problems I'll change it for v2.3.

@tobyweston tobyweston added this to the 2.3 milestone Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants