[
https://issues.apache.org/jira/browse/SVN-4907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17584798#comment-17584798
]
Daniel Shahaf commented on SVN-4907:
------------------------------------
Please don't use bold red.
Can you attach a code sample that we can compile and run ourselves and
reproduces the problem?
Does this reproduce in 1.14.x?
What's the output of `svnadmin info` on the repository in question?
What's the the memory on average per call after N calls? After 2N calls?
(choose N)
Are REV and ROOT the same every time?
What's the caching configuration?
Please answer all these questions on the mailing list rather than here.
> svn_fs_node_id causes memory leak...
> ------------------------------------
>
> Key: SVN-4907
> URL: https://issues.apache.org/jira/browse/SVN-4907
> Project: Subversion
> Issue Type: Bug
> Components: svnlook
> Affects Versions: 1.10.x
> Reporter: Nathan.qian
> Priority: Critical
>
> We used svnlook to transform a dynamic library for some of our interface
> operations. We found that memory leaks would occur when svn_fs_node_id (with
> apr_pool_t and svn_pool_destroy(pool)) was called frequently;
> The code looks shown below, we call svn_fs_node_id with apr_pool_t , and
> after the call , we use svn_pool_destroy(pool) clear memory. But there is a
> bug : if we use *{color:#ff0000}a nonexistent path call
> subcommand_show_revison, the memory will leak{color}* ; but if
> {color:#ff0000}*a existing path, the memory is ok, no memory leak*{color} .
>
> int init_svncmcenter(apr_pool_t *pool,char *out_str,const char
> *repos_path,const char *path,const char **path_relative,const char
> *rev,struct svnlook_opt_state *opt_state,svn_fs_root_t **root,const
> svn_fs_id_t **id,svnlook_ctxt_t * *c,int with_lastexist )
> {
> ......
> ......
> if ((svn_fs_node_id(id, *root, *path_relative, pool)) != SVN_NO_ERROR ||
> !(*id))
>
> {
> {color:#FF0000}*//memory leak happens here*{color}
> printf("path (%s) error. Warning: svn_fs_node_id may cause memory
> leaks.\n", path); sprintf(out_str,"212 path error"); return 212;
> }
> return 200;
> }
> int subcommand_show_revison(const char *repos_path,const char *path,const
> char *rev,char *out_str,int b_filesize,int with_changed_date,int with_author)
> {
> apr_pool_t *pool =
> apr_allocator_owner_get(svn_pool_create_allocator(FALSE));
> ......
> ......
> if (init_svncmcenter(pool,out_str, repos_path,
> path,&path_relative,rev,&opt_state,&root,&id,&c,1) != 200)
> {
> {color:#ff0000} *svn_pool_destroy(pool);*{color}
> return -1;
> }
> ......
> ......
> svn_pool_destroy(pool);
> return 0;
> }
--
This message was sent by Atlassian Jira
(v8.20.10#820010)