How to periodically restart Jira?
Asked by Christian Schneider:

Hi dear community,

we are running Jira 8.13 on Ubuntu and our test-system periodically stops working due to out of memory.

As this is only happening on our testsystem and basially only afects myself, I would like to have a quick and easy solution. I tried to stop and start jira manually, which solved the issue.

I tried to implement a cron-job to stop and restart jira every monday night, but it doesn't work - well the event triggers, but jira does not stop, nor restart.

```
# Jira Service jeden Montag Morgen um 00:00 stoppen
0 0 * * 1 /etc/init.d/jira stop

# Jira Service jeden Montag Morgen um 00:03 wieder starten
3 0 * * 1 /etc/init.d/jira start
```

Logs are not very helpful.

*** ** * ** ***

Sep 19 23:58:40 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:54899-\>\[10.50.70.206\]:161  
Sep 19 23:59:01 cl1app-06-t CRON\[6966\]: (root) CMD (command -v debian-sa1 \> /dev/null \&\& debian-sa1 60 2)  
Sep 20 00:00:01 cl1app-06-t CRON\[6972\]: (root) CMD (/etc/init.d/jira stop)  
Sep 20 00:00:01 cl1app-06-t CRON\[6971\]: (CRON) info (No MTA installed, discarding output)  
Sep 20 00:00:40 cl1app-06-t systemd\[1\]: Starting Discard unused blocks...  
Sep 20 00:00:40 cl1app-06-t systemd\[1\]: Started Discard unused blocks.  
Sep 20 00:02:05 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:65020-\>\[10.50.70.206\]:161  
Sep 20 00:02:05 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:65036-\>\[10.50.70.206\]:161  
Sep 20 00:02:15 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:65223-\>\[10.50.70.206\]:161  
Sep 20 00:02:20 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:65316-\>\[10.50.70.206\]:161  
Sep 20 00:02:25 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:58052-\>\[10.50.70.206\]:161  
Sep 20 00:02:30 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:58151-\>\[10.50.70.206\]:161  
Sep 20 00:02:35 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:58239-\>\[10.50.70.206\]:161  
Sep 20 00:02:40 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:58428-\>\[10.50.70.206\]:161  
Sep 20 00:02:45 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:58513-\>\[10.50.70.206\]:161  
Sep 20 00:02:50 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:59024-\>\[10.50.70.206\]:161  
Sep 20 00:02:55 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:59113-\>\[10.50.70.206\]:161  
Sep 20 00:03:00 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:51711-\>\[10.50.70.206\]:161  
Sep 20 00:03:01 cl1app-06-t CRON\[7002\]: (root) CMD (/etc/init.d/jira start)  
Sep 20 00:03:01 cl1app-06-t CRON\[7001\]: (CRON) info (No MTA installed, discarding output)  
Sep 20 00:03:05 cl1app-06-t snmpd\[1148\]: Connection from UDP: \[10.50.70.65\]:51800-\>\[10.50.70.206\]:161

*** ** * ** ***

Any help is very much appreciated.


Answers:
author: Christian Schneider
body: Hi everybody,

we did an upgrade to version 8.19.1, which solved the issue. No periodical restart nessesary.

Unfortunately, version 8.19.1 has a bug, which affects us:

* ["we couldn't load screens" Error (atlassian.com)](https://community.atlassian.com/t5/Jira-questions/quot-we-couldn-t-load-screens-quot-Error/qaq-p/1820814)
* [Customer Portal: Choose whether you need search (atlassian.com)](https://community.atlassian.com/t5/Jira-Service-Management/Customer-Portal-Choose-whether-you-need-search/qaq-p/1827611)


author: Fadoua
body: [@Christian Schneider](/t5/user/viewprofilepage/user-id/4404092)

You shouldn't have this problem. I won't suggest you to restart the service every week. There are instances running 24/7

If you are seeing an Out of Memory issue that means your system doesn't meet may be the required configuration. Please check the following doc:

<https://confluence.atlassian.com/adminjiraserver/jira-applications-installation-requirements-938846826.html>

Let me know if you have any questions

Best,

Fadoua

comments: author: Christian Schneider
body: Thank you very much for your replay. Our live-system is running 24/7 without any (memory) issues.

I will check your link. But as I indicated, this only affects me and I cannot allocate more ressources to the system. A simple reboot would do the trick. :-)


author: Fadoua
body: Sometimes too much can create a problem as well. This is from experience.

Best way is to check Atlassian System requirements. It is very helpful.

All the best,

Fadoua


Tags: cron

out-of-memory

server

ubuntu