-
Notifications
You must be signed in to change notification settings - Fork 358
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
Is ParseWithClaims function make a memory leak ? #266
Comments
Thanks for the detailed issue. Can you please provide more details on the Also, are you using custom claims and embedding those provided by this package? Ideally, I'd like to reproduce this locally to mimic your environment as much as possible. |
@mfridman Sorry for late replying from your question KeyFunc is just a simple function _, err := jwt.ParseWithClaims(bpJWT, bpClaims, func(token *jwt.Token) (interface{}, error) {
return config.Secret, nil
}) Now, I already solve this problem. Let's me explain it. In my case I used this as internal service that will received the jwt token from other internal service so when it used it internal decided to ignore error when secret is invalid. So when I fix it by update the secret to correct secret the memory did not leak. But, I still have a question why when I |
Thank you for those details. We've recently refactored the project, so I'd like to investigate the v5.0.0-rc.1 release |
Is ParseWithClaims function make a memory leak ?
I use
golang-jwt/jwt/[email protected]
to parse jwt string to struct by ParseWithClaims. Our service have1350 req/sec
at peak time. So I monitoring the pods memory and visualize its by grafana see belowAfter that I dump the
heap profiling
from our services and visualize its bygo tool pprof
and selected the sample toinuse_space
. Pls See belowGraph view
Source View
My implemented code. See below
The text was updated successfully, but these errors were encountered: