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

Currently Online:
15 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: 736

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6450

Newest Members:

kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism

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

Administrators: admin: 1