omegaup/quark

More memory leaks in the ephemeral grader

Closed this issue · 0 comments

It turns out that we still had a few more memory leaks lurking.

$ go tool pprof -base omegaup-grader.0.pprof omegaup-grader.1.pprof
File: omegaup-grader
Build ID: cd5137dd10c1d2fc617f2d6beae1e80e12bf733b
Type: inuse_space
Time: Feb 20, 2019 at 2:46am (UTC)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) top
Showing nodes accounting for 468.37MB, 100% of 468.37MB total
Dropped 13 nodes (cum <= 2.34MB)
Showing top 10 nodes out of 24
      flat  flat%   sum%        cum   cum%
  167.02MB 35.66% 35.66%   455.87MB 97.33%  github.com/omegaup/quark/common.NewLiteralInputFactory
  149.34MB 31.89% 67.55%   149.34MB 31.89%  bytes.makeSlice
      67MB 14.31% 81.85%       67MB 14.31%  math/big.nat.make (inline)
   50.50MB 10.78% 92.63%   117.01MB 24.98%  github.com/omegaup/quark/common.RationalDiv
   22.50MB  4.80% 97.44%    22.50MB  4.80%  fmt.Sprintf
      12MB  2.56%   100%       12MB  2.56%  encoding/json.(*decodeState).literalStore
         0     0%   100%   149.34MB 31.89%  bytes.(*Buffer).WriteString
         0     0%   100%   149.34MB 31.89%  bytes.(*Buffer).grow
         0     0%   100%       12MB  2.56%  encoding/json.(*Decoder).Decode
         0     0%   100%       12MB  2.56%  encoding/json.(*decodeState).object

image