Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Threads still active after shutdown
July 19, 2016
10:41, EEST
Avatar
mmaus
Member
Members
Forum Posts: 4
Member Since:
April 7, 2016
sp_UserOfflineSmall Offline

Hello,

we’re using the server inside an OSGI (Equinox) application, which requires applications (the UaServer is part of the “application”) to shut down in less than 15 seconds after the shutdown request has been received.
After server.shutdown(0, “”) and/or server.close(), the server says “UaServer closed”, but there seems to be active threads – because the OSGI framework program, which launches our application, tries to kill all remaining Threads (“Blocking-Work-Executors”). Is there any way to terminate all server threads after server.shutdown()?

Furthermore, these remaining threads seem also related to a memory leak: After restarting our application several times (after the framework tried to kill the remaining threads), we get a PermGenSpace error from the JVM.

July 19, 2016
11:18, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Those threads are from the Stack (not SDK) and are static, therefore it is a bit hard to create proper automatic shutdown for them. Please use StackUtils.shutdown() to do it manually.

Related possible memory leaks are fixed in stack version 1.03.340 https://github.com/OPCFoundation/UA-Java/milestone/1?closed=1. SDK future version 2.3 will use that (or later). When/if https://github.com/OPCFoundation/UA-Java/issues/40 is implemented (https://github.com/OPCFoundation/UA-Java/milestone/2) then we most likely move to automatically shutting down the threads in server shutdown.

– Bjarne

July 19, 2016
11:48, EEST
Avatar
mmaus
Member
Members
Forum Posts: 4
Member Since:
April 7, 2016
sp_UserOfflineSmall Offline

Thank you very much,

your hint with StackUtis.shutdown() solved the issue with rebooting!
I’ll be looking forward for 2.3 for the memory leak issues.

-Moritz

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
10 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

TimK: 41

Member Stats:

Guest Posters: 0

Members: 683

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1