br...@apache.org writes:

> Author: brane
> Date: Wed Apr 29 15:30:54 2015
> New Revision: 1676769
>
> URL: http://svn.apache.org/r1676769
> Log:
> Fix another silly memory leak in JavaHL.
> This time, we forgot to close off a JNI frame.

> -        m_env->CallObjectMethod(m_map, m_put_mid, jpropName, jpropVal);
> +        jobject ret = m_env->CallObjectMethod(m_map, m_put_mid,
> +                                              jpropName, jpropVal);
>          if (JNIUtil::isJavaExceptionThrown())
>            return;
>  
> -        m_env->DeleteLocalRef(jpropName);
> +        m_env->DeleteLocalRef(ret);

Should we do the same to the other places we use CallObjectMethod
without calling DeleteLocalRef?  As I understand it the local ref
"leaks" are temporary and only really matter if we create them in some
sort of loop.  So perhaps

  CreateJ::LockMap
  RemoteSession::getMergeinfo (and the fill_dirents and
                               location_hash_to_map functions)

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*

Reply via email to