From: "Zhang, Helin" <helin.zhang@intel.com>
To: "zhang.zhangkun@huawei.com" <zhang.zhangkun@huawei.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: zhangkun <zhangk.zhangkun@huawei.com>
Subject: Re: [dpdk-dev] [PATCH] there are some memory leak about Dir operator
Date: Tue, 19 Aug 2014 03:53:25 +0000 [thread overview]
Message-ID: <F35DEAC7BCE34641BA9FAC6BCA4A12E70A77F3DE@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1408419580-19684-1-git-send-email-zhang.zhangkun@huawei.com>
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of
> zhang.zhangkun@huawei.com
> Sent: Tuesday, August 19, 2014 11:40 AM
> To: dev@dpdk.org
> Cc: zhangkun
> Subject: [dpdk-dev] [PATCH] there are some memory leak about Dir operator
>
> From: zhangkun <zhangk.zhangkun@huawei.com>
>
>
> Signed-off-by: zhangkun <zhangk.zhangkun@huawei.com>
> ---
> lib/librte_eal/linuxapp/eal/eal_hugepage_info.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
> b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
> index b72a205..d784b7c 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c
> @@ -311,12 +311,14 @@ eal_hugepage_info_init(void)
> /* if blocking lock failed */
> if (flock(hpi->lock_descriptor, LOCK_EX) == -1) {
> RTE_LOG(CRIT, EAL, "Failed to lock hugepage
> directory!\n");
> + closedir(dir);
> return -1;
> }
> /* clear out the hugepages dir from unused pages */
> - if (clear_hugedir(hpi->hugedir) == -1)
> + if (clear_hugedir(hpi->hugedir) == -1) {
> + closedir(dir);
> return -1;
> -
> + }
> /* for now, put all pages into socket 0,
> * later they will be sorted */
> hpi->num_pages[0] =
> get_num_hugepages(dirent->d_name);
> --
> 1.7.3.1.msysgit.0
>
Hi Zhangkun
Could you help to explain more detailed about the memory leak? Wouldn't the OS take care of those closing during process exiting?
Regards,
Helin
next prev parent reply other threads:[~2014-08-19 3:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-19 3:39 zhang.zhangkun
2014-08-19 3:53 ` Zhang, Helin [this message]
2014-08-19 6:10 ` [dpdk-dev] 答复: " Zhangkun (K)
2014-08-19 3:51 [dpdk-dev] " zhang.zhangkun
2014-08-29 10:43 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F35DEAC7BCE34641BA9FAC6BCA4A12E70A77F3DE@SHSMSX104.ccr.corp.intel.com \
--to=helin.zhang@intel.com \
--cc=dev@dpdk.org \
--cc=zhang.zhangkun@huawei.com \
--cc=zhangk.zhangkun@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).