prometheus-client-c icon indicating copy to clipboard operation
prometheus-client-c copied to clipboard

Is it possible to open new API to clear data?

Open yuanchieh-cheng opened this issue 3 years ago • 3 comments

After run prometheus client for a long time, the memory keep eating up.
It would be better if I could simply call a api to flush all the collected data.
Is it possible or any better solution to prevent out of memory trouble?

yuanchieh-cheng avatar Dec 16 '20 07:12 yuanchieh-cheng

There is not. Based on the test coverage that exists currently, there are no memory leaks; we maintain a suite of tests that check for these in CI. However, that doesn't necessarily mean there is not a possible memory leak in places where the library is not tested. I believe the best path forward it to improve the test coverage such that we can prove with absolute certainty that no leaks exists. Until then, please be diligent about using tools like Valgrind to determine where your memory issues might exist.

miroswan avatar Dec 17 '20 17:12 miroswan

Sorry for my bad description.
I think this it not memory leak issue. The memory keep eating up just because there is no way to clear the data and the memory would ultimately run out.
Or is there any memory control mechanism inside the library ? What will happen if I keep add metrics data ?

When I read the prometheus documentation, I could set the expiration time or max storage size to prevent the memory or disk full issue.
That's why I ask for exposing a API to clear the data.

Actually I came from this issue https://github.com/coturn/coturn/issues/666

yuanchieh-cheng avatar Dec 18 '20 01:12 yuanchieh-cheng

Sorry for my bad description. I think this it not memory leak issue. The memory keep eating up just because there is no way to clear the data and the memory would ultimately run out. Or is there any memory control mechanism inside the library ? What will happen if I keep add metrics data ?

When I read the prometheus documentation, I could set the expiration time or max storage size to prevent the memory or disk full issue. That's why I ask for exposing a API to clear the data.

Actually I came from this issue coturn/coturn#666

Could you please explain, how did you solve this issue?

batusekerci avatar Feb 06 '23 10:02 batusekerci