haskell icon indicating copy to clipboard operation
haskell copied to clipboard

Space leak in getNodes or getFetch

Open basvandijk opened this issue 7 years ago • 1 comments

In a production server we had a major space leak that I tracked down to our usage of tensorflow. Heavily simplified our code looked like:

runSession $ do
  addGraphDef g
  forever $ do
    ...
    output <- runWithFeeds [ feed inTens ... ] outTens
    ...

After changing the code to the following the space leak went away:

runSession $ do
  addGraphDef g
  ns <- build $ getNodes outTens
  fetch <- build $ getFetch outTens
  forever $ do
    ...
    output <- runFetchWithFeeds [ feed inTens ... ] ns fetch
    ...

Note that for this to build I did have to patch tensorflow to export runFetchWithFeeds.

So clearly build $ getNodes t and / or build $ getFetch t is leaking. Any idea why?

basvandijk avatar Dec 07 '18 05:12 basvandijk

@basvandijk if you happen to have a smallish test case I'll happily start with it rather than writing my own. If not - no sweat.

blackgnezdo avatar Dec 08 '18 22:12 blackgnezdo