Skip to content

Commit a2354dd

Browse files
committed
Add note detailing possible memory leak in StoreReporter
1 parent f147aed commit a2354dd

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/dotty/tools/dotc/reporting/StoreReporter.scala

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,16 @@ import config.Printers.typr
88
import diagnostic.MessageContainer
99
import diagnostic.messages._
1010

11-
/**
12-
* This class implements a Reporter that stores all messages
13-
*/
11+
/** This class implements a Reporter that stores all messages
12+
*
13+
* Beware that this reporter can leak memory, and force messages in two
14+
* scenarios:
15+
*
16+
* - During debugging `config.Printers.typr` is set from `noPrinter` to `new
17+
* Printer`, which forces the message
18+
* - The reporter is not flushed and the message containers capture a
19+
* `Context` (about 4MB)
20+
*/
1421
class StoreReporter(outer: Reporter) extends Reporter {
1522

1623
private var infos: mutable.ListBuffer[MessageContainer] = null

0 commit comments

Comments
 (0)