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: 1032
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: 1919

Currently Online:
37 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 730

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

PromotionToold, HypromeImpupe, toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1