Hi:
I think JCA 2.3.1 and also the latest 2.3.2 have a small memory
leak in JNIChannel.addMonitor() resp. JNIMonitor.clear():
They ultimately call JNI code in JNI.cpp, where
"new MonitorID" allocates a small structure that's not
freed up in the clearMonitor counterpart:
JNIEXPORT jlong JNICALL Java_gov_aps_jca_jni_JNI__1ch_1addMonitor(JNIEnv
*env, jclass, jint type, jint length, jlong channelID, jobject callback,
jint mask)
{
MonitorID* monitorID= new MonitorID;
monitorID->callback= env->NewGlobalRef(callback);
checkstatus( env, ca_add_masked_array_event(type,length,CHID(channelID),
&theArrayMonitorCallback,
monitorID->callback,0,0,0,&monitorID->pevid,mask));
return (jlong)monitorID;
}
JNIEXPORT void JNICALL Java_gov_aps_jca_jni_JNI__1ch_1clearMonitor(JNIEnv
*env, jclass, jlong monitorID)
{
checkstatus( env, ca_clear_event(((MonitorID*)monitorID)->pevid) );
env->DeleteGlobalRef(((MonitorID*)monitorID)->callback);
// Needs something like this?
// delete ((MonitorID*)monitorID)
}
Thanks,
-Kay
- Navigate by Date:
- Prev:
Re: connections with pasynOctetSyncIO->connect John Hammonds
- Next:
Re: connections with pasynOctetSyncIO->connect John Hammonds
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
<2009>
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
EPICS Meeting Vancouver Rolf Keitel
- Next:
CLS Openings in the Control and Instrumentation Group Elder Matias
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
<2009>
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|