Please consider registering

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
Forum Posts: 9
Member Since:
April 22, 2016
sp_UserOfflineSmall Offline

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.

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
Bjarne Boström
Forum Posts: 382
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline


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
Forum Posts: 9
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: 78

Currently Online:
14 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 89

pramanj: 86

ibrahim: 68

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 36

Rainer Versteeg: 32

peterrob45: 25

Member Stats:

Guest Posters: 0

Members: 857

Moderators: 12

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 872

Posts: 3676

Newest Members:

virgie88y3407, bennetcole, timbo, malissa6674, Markus Johansson, jonathancamp, michell9665, bqpkelvin990391, Christopher, HuMa

Moderators: Jouni Aro: 827, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 382, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 15, Markus Johansson: 1

Administrators: admin: 0