I'm running a wildfly 10 app on RedHat Openshift.

It is running a very small web service with no database or anything special, and it works OK.

After a bit (an hour, 2 maybe) the app stops responding to 'rhc ssh appname' with the error:

> 
> /Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.2/lib/net/ssh/transport/packet\_stream.rb:89:in
>  `next\_packet': connection closed by remote host (Net::SSH::Disconnect)
> 
> 
> 

The web service still responds, but I cannot ssh or tail the logs or anything to figure out what is wrong.

I have to force-stop it and start it again, and it starts working for awhile again.

How do I troubleshoot further? I cannot see anything...
['https://Stackoverflow.com/questions/34492643', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1022260/']
SFTP into your app and look at the log files. I use WinSCP on windows.
As suggested above, this is most likely your gear running out of memory. I would suggest that you stop/start your gear, and then check for memory limit violations (<https://developers.openshift.com/en/troubleshooting-faq.html#_why_is_my_application_restarting_automatically_or_having_memory_issues>), you can also change the amount of memory that is allocated to the JVM (<https://developers.openshift.com/en/wildfly-jvm-memory.html>). The best solution would probably be to go ahead and use a larger gear size, probably at least a medium, but you'll have to see how things go.