summaryrefslogtreecommitdiff
path: root/test/files/presentation/memory-leaks
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2012-04-09 12:32:33 +0200
committerIulian Dragos <jaguarul@gmail.com>2012-04-09 12:32:56 +0200
commit14fbad93cb212466440b92a286dab6d13fb6d09e (patch)
tree5bd27177741e9a83671835a06533073dac805ea0 /test/files/presentation/memory-leaks
parent174a75f78df9436884100768eff7ec938315280d (diff)
downloadscala-14fbad93cb212466440b92a286dab6d13fb6d09e.tar.gz
scala-14fbad93cb212466440b92a286dab6d13fb6d09e.tar.bz2
scala-14fbad93cb212466440b92a286dab6d13fb6d09e.zip
Bumped the number of samples of the memory leaks test to 50. This should make it much more resilient against spikes. Also removed usedmem file dumps.
Diffstat (limited to 'test/files/presentation/memory-leaks')
-rw-r--r--test/files/presentation/memory-leaks/MemoryLeaksTest.scala21
1 files changed, 11 insertions, 10 deletions
diff --git a/test/files/presentation/memory-leaks/MemoryLeaksTest.scala b/test/files/presentation/memory-leaks/MemoryLeaksTest.scala
index e24f36d7b6..45b38da85b 100644
--- a/test/files/presentation/memory-leaks/MemoryLeaksTest.scala
+++ b/test/files/presentation/memory-leaks/MemoryLeaksTest.scala
@@ -33,7 +33,7 @@ object Test extends InteractiveTest {
new BatchSourceFile(AbstractFile.getFile(name))
def memoryConsumptionTest() {
- val N = 10
+ val N = 50
val filename = "usedmem-%tF.txt".format(Calendar.getInstance.getTime)
val typerUnit = AbstractFile.getFile(baseDir.parent.parent.parent.parent / "src/compiler/scala/tools/nsc/typechecker/Typers.scala")
@@ -56,18 +56,10 @@ object Test extends InteractiveTest {
typeCheckWith(typerUnit, src)
}
-// println("UsedMem:\t%d\t%d".format(i, usedMem / mega))
usedMem / mega // report size in MB
}
-
- // println("=" * 80)
- val outputFile = new PrintWriter(new FileOutputStream(filename))
- outputFile.println("\tusedMem")
- for ((dataPoint, i) <- usedMem.zipWithIndex) {
- outputFile.println("%d\t%d".format(i, dataPoint))
- }
- outputFile.close()
+ //dumpDataToFile(filename, usedMem)
// drop the first two measurements, since the compiler needs some memory when initializing
val (a, b) = linearModel((3L to N).toSeq, usedMem.drop(2))
//println("LinearModel: constant: %.4f\tslope:%.4f".format(a, b))
@@ -83,6 +75,15 @@ object Test extends InteractiveTest {
askReload(Seq(sourceFile))
askLoadedTyped(sourceFile).get // block until it's here
}
+
+ private def dumpDataToFile(filename: String, usedMem: Seq[Long]) {
+ val outputFile = new PrintWriter(new FileOutputStream(filename))
+ outputFile.println("\tusedMem")
+ for ((dataPoint, i) <- usedMem.zipWithIndex) {
+ outputFile.println("%d\t%d".format(i, dataPoint))
+ }
+ outputFile.close()
+ }
/** Return the linear model of these values, (a, b). First value is the constant factor,