-
-
Notifications
You must be signed in to change notification settings - Fork 412
Open
Labels
performanceIssues about memory consumption, responsiveness, etc.Issues about memory consumption, responsiveness, etc.type: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Description
haskell-language-server/ghcide/src/Development/IDE/Core/Rules.hs
Lines 506 to 513 in e0a4642
| (currentSource,ver) <- liftIO $ do | |
| mvf <- getVirtualFile vfs $ filePathToUri' file | |
| case mvf of | |
| Nothing -> (,Nothing) . T.decode encoding <$> BS.readFile (fromNormalizedFilePath file) | |
| Just vf -> pure (Rope.toText $ _text vf, Just $ _lsp_version vf) | |
| let refmap = generateReferencesMap . getAsts . hie_asts $ res | |
| del = deltaFromDiff (T.decode encoding $ hie_hs_src res) currentSource | |
| pure (HAR (hie_module res) (hie_asts res) refmap mempty (HieFromDisk res),del,ver) |
del in line 512 keeps two large byte strings alive:
- source code of the .hs file on disk
- source code recorded in the .hie file
This is leaked for all the modules in the project with an entry in the hiedb and a .hie file (all in most circumstances).
The memory leak is not flushed until the HieAstResult is actually used and the PositionMapping is forced.
Metadata
Metadata
Assignees
Labels
performanceIssues about memory consumption, responsiveness, etc.Issues about memory consumption, responsiveness, etc.type: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..