Open gaborcsardi opened 4 years ago
I think the openssl base64 decoder is leaking a bit, but I can't see what I'm doing wrong.
I think at least part of the problem is fixed. I'm getting this now:
> ps::ps_memory_info(ps::ps_handle())
rss vms pfaults pageins
164724736 4729516032 88142 0
> #> rss vms pfaults pageins
> #> 64491520 4481400832 16576 123
>
> for (i in 1:10000) openssl::my_pubkey()
> ps::ps_memory_info(ps::ps_handle())
rss vms pfaults pageins
164872192 4729516032 106147 0
> #> rss vms pfaults pageins
> #> 72728576 4482637824 18587 123
>
> for (i in 1:10000) openssl::my_pubkey()
> ps::ps_memory_info(ps::ps_handle())
rss vms pfaults pageins
164884480 4729516032 107014 0
Actually I cannot reproduce this with the CRAN version. For me the usage stabilizes after a while, maybe the memory from your example is just added to R's memory pool, but not lost.
Does this keep growing infinitely for you?
for(i in 1:500){
for (i in 1:1000) openssl::my_pubkey()
rm(list=ls()); gc()
print(ps::ps_memory_info(ps::ps_handle()))
}
Othewise it may have to do with the version of libssl.
Yeah, it is growing, slowly.
EDIT: maybe not indefinitely....
Yeah, I think it is good.
This would make a nice tool for spotting memory leaks btw. Where you can feed it a function, and it will repeatedly call it and show how memory usage grows over time.
IDK, it is a lot more low-tech than valgrind. :)
Valgrind often has so many false positives that it's hard to make sense of it, and see how serious the problem is.
Seems like
read_pubkey()
leaks a bit of memory: