15:30, EEST
September 25, 2013
Hi all, i have this problem : testing your OPC UA Client, i wrapped it into an OSGi bundle ( i’m working on Eclipse Equinox).
I created a simple thread that writes every second a random integer value on a MemoryBased variable (I’m using Kepware OPC UA Server).
If i register my variable on a MonitoredDataItemListener, the java process memory (Private Bytes) raises from 151 mb to 155 mb in less than an hour.
Instead, if i don’t use a MonitoredDataItemListener, and maintain the same write procedure, the process memory is more stable (~0.2 Mb in 30 minutes).
I’m not able to understand if this is a real leak, or it is a normal memory fluctuation, and with a long-time run it disappears….is it possible to run the evaluation library for an entire day (and not only for 2 hours)?
Otherwise, this is my write procedure :
public void writeItem(String itemFullName, Object value) throws Exception {
//translate itemFullName, i.e. MB.LW_MONITOR.LW_HEART_BEAT_TH1 , in a ReferenceDescription
ReferenceDescription found=util.getItemReference(itemFullName);
NodeId nodeId=client.getNamespaceTable().toNodeId(found.getNodeId());
UaNode node = client.getAddressSpace().getNode(nodeId);
if(node==null) throw new Exception(“Null node!”);
UaVariable v = (UaVariable) node;
if (v.getDataType() == null)
v.setDataType(client.getAddressSpace().getType(v.getDataTypeId()));
UaDataType dataType = (UaDataType) v.getDataType();
Object convertedValue=null;
try {
convertedValue = dataType != null ? client.getAddressSpace().getDataTypeConverter().parseVariant(value.toString(), dataType): value;
} catch (Exception e) {
logger.log(LogService.LOG_ERROR,”writeItem ERROR on writing [“+itemFullName+”] as [“+value+”] : ” + LogUtils.getMessageAndStackTrace(e));
}
boolean status = client.writeAttribute(nodeId, Attributes.Value,convertedValue);
if(!status)
logger.log(LogService.LOG_WARNING, “Item “+itemFullName+” written ASYNCROUSLY @ “+value);
}
I register the item using this procedure (my test item is member of an OPC Group, and i register all the variables of this group):
// get the reference to MB.LW_MONITOR group
ReferenceDescription found=util.getGroupReference(groupName);
List itemList = this.client.getAddressSpace().browse(client.getNamespaceTable().toNodeId(found.getNodeId()));
// create a subscription instance for entire group
Subscription subscription =new Subscription();
for(ReferenceDescription rd:itemList){
NodeId nd=client.getNamespaceTable().toNodeId(rd.getNodeId());
MonitoredDataItem mi=new MonitoredDataItem(nd, Attributes.Value, MonitoringMode.Reporting);
mi.addChangeListener(cacheListener); // cacheListener is my MonitoredDataItemListener instance…
subscription.addItem(mi);
}
// add subscription to the client
client.addSubscription(subscription);
thanks
18:34, EEST
December 21, 2011
13:19, EEST
September 25, 2013
Hi Jouni,
thank you for your response.
I yet tried JVisualVM, and i didn’t find the same behaviour.
The heap memory is always under control (but I saw a lot of thread, also 50-60, all named Blocking-Work-Executorxxx and this kind of thread lives for 10 seconds, and then dies….is it normal?)
I’d like run my test program for at least 1 day, or 1 week, to see the real memory behaviour…..is it possible? Can i have a license for at least 24-hour run?
thank you
14:26, EEST
December 21, 2011
15:50, EEST
September 25, 2013
Can you give me the right email address?
I only have this : sales@prosysopc.com
thanks
Most Users Ever Online: 1919
Currently Online:
25 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: 735
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1523
Posts: 6449
Newest Members:
rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1