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
How to clear memory of instance com.prosysopc.ua.server.nodes.CacheProperty
April 23, 2019
11:08, EEST
Avatar
HOYOUNG KANG
Member
Members
Forum Posts: 11
Member Since:
April 22, 2016
sp_UserOfflineSmall Offline

Hello,
My Server Program based on Prosys Java SDK has memory leak problem.
I analyzed my snapshot using Eclipse Memory Analyzer.
The Leak Suspects Report of it shows one “Problem Suspect 1” as following:

=====================================================================
1,897,833 instances of “com.prosysopc.ua.server.nodes.CacheProperty”,
loaded by “com.lsis.smartlv.maintsw.thirdparty” occupy 1,389,888,312 (67.79%) bytes.
Keywords
com.prosysopc.ua.server.nodes.CacheProperty
com.lsis.smartlv.maintsw.thirdparty
=====================================================================

Even though I shutdown by calling “UaServer.shutdown(5, new LocalizedText(“Closed by user”, Locale.ENGLISH))” and manual gabage collector, I can’t clear instances of CacheProperty.
Please tell me how to clear instances of “com.prosysopc.ua.server.nodes.CacheProperty”.

April 23, 2019
12:55, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Hmm thats quite many of them.. which version of the Java SDK you are using?

After the 5 seconds have passed (the first argument), do you still hold reference to the UaServer object in any way? If yes then that could be the cause. The NodeManagers are not destroyed when the server is shut down, as it can be restarted. However if you no longer hold the reference to the UaServer object at all, then they all should be garbage collected (unless you e.g. refer a manager directly).

If you want to clear all resources (which are normally done automatically when JVM shuts down), you will need to also call the static StackUtils.shutdown() method to shut down the common threadpool the lower level implementations use.

P.S. you should be able to use “Paths to GC root” feature to show which part is holding the instance from being garbage collected, https://www.eclipse.org/mat/about/dominator_tree.png

April 23, 2019
16:48, EEST
Avatar
HOYOUNG KANG
Member
Members
Forum Posts: 11
Member Since:
April 22, 2016
sp_UserOfflineSmall Offline

I’m using 3.2.0 version of the Java SDK.
The static StackUtils.shutdown() method clear all resources perfectly!
Thank you so much, Bjarne Boström.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
13 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 680

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores Frederick

Moderators: Jouni Aro: 1009, 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