Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not sure whether it is an issue or not. #6

Closed
Gongnai opened this issue Jun 12, 2019 · 7 comments
Closed

Not sure whether it is an issue or not. #6

Gongnai opened this issue Jun 12, 2019 · 7 comments

Comments

@Gongnai
Copy link

Gongnai commented Jun 12, 2019

Have downloaded source code :
-rw-rw-r-- 1 zhaog man 3.2K Jun 9 23:37 README.md
-rw-rw-r-- 1 zhaog man 198 Jun 9 23:37 Makefile
-rw-rw-r-- 1 zhaog man 15K Jun 9 23:37 libleak.c
drwxrwxr-x 2 zhaog man 152 Jun 12 10:51 libwuya/

Tried to build it up by kicking off command make in below old linux box
Linux ceres 2.4.21-32.ELsmp #1 SMP Fri Apr 15 21:17:59 EDT 2005 i686 i686 i386 GNU/Linux

But looks like it was failed with bunch of errors.
Build log was attached. Could you please take a look?
Thanks
build.log

@WuBingzheng
Copy link
Owner

WuBingzheng commented Jun 13, 2019

Is the libwuya/ empty?

libwuya is another project and used as git-submodule here.
So you can get it by git clone with --recursive:

$ git clone --recursive https://github.com/WuBingzheng/libleak.git

or you can download its source from here to libwuya/ directory.

@Gongnai
Copy link
Author

Gongnai commented Jun 13, 2019 via email

@Gongnai
Copy link
Author

Gongnai commented Jun 14, 2019

Hi Wubing,
Thanks for your quick reply. libwuya was built successfully with a minor defect that I have fixed on my side.
Compiler of my linux box is really old by using C99 mode. And it can not declare a variable and initialize it in one shot. Have to split it into 2 lines like below:

For example:
File wuy_skiplist.c

Before:
for ( int i = level - 1; i > 0; i--) {
..
}

After:
int i;
for (i = level - 1; i > 0; i--) {
..
}

File: wuy_heap.c
Before:
for ( size_t i = 0; i < heap->count; i++) {
...
}

After:
size_t i;
for ( size_t i = 0; i < heap->count; i++) {
...
}

Other than that, it is pretty good.
Thanks

@Gongnai
Copy link
Author

Gongnai commented Jun 14, 2019

Wubing,

A question for you.
If an application has a kind of cache memory , that means some memory will stay for ever except application exits.

What kind of expire threshold will be set under this case? Maybe around 5mins?
And some memory was really leaking like memory will be increasing every 20 secs.
Any ideas or suggestions on this scenario?

Thanks in advance.
Gongnai

@WuBingzheng
Copy link
Owner

If the leak happens at cache memory, which means some place allocates memory from the cache but does not put back to the cache forever, it's hard to find the leak by libleak. However if most of the cache memory is allocated by the leak-place, which is very possible, the leak-place will be shown many times in libleak output and you can guess it.

If the leak happens not at cache memory, you can focus on non-cache-memory in libleak output and should find the leak-place easily.

In both case, 20secs or 1min should be OK.

@Gongnai
Copy link
Author

Gongnai commented Jun 17, 2019

Thanks for your reply. However there was a core dump when have tried to kick off leaklib, looks like 32bits linux box doesn't like leaklib. I can't spend extra time on digging into this core file.
Will use Valgrind then. Anyways thanks for your time.

@WuBingzheng
Copy link
Owner

I did not test on 32bit linux.
I will test it later at free time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants