summaryrefslogtreecommitdiff
path: root/src/main/scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala')
-rw-r--r--src/main/scala/main/domain/MemoryOperations.scala31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/main/scala/main/domain/MemoryOperations.scala b/src/main/scala/main/domain/MemoryOperations.scala
index 464d0bc..eb9649b 100644
--- a/src/main/scala/main/domain/MemoryOperations.scala
+++ b/src/main/scala/main/domain/MemoryOperations.scala
@@ -3,30 +3,39 @@ package main.domain
import main.services._
import scala.util.hashing
-import scala.util.hashing.MurmurHash3
-import scala.math._
+import scala.util.hashing.MurmurHash3 import scala.math._
import scala.collection.immutable.ListSet
-import scala.collection.mutable.ArrayBuffer
+import java.nio.ByteBuffer
/**
*
* Large memory object to allocate on the heap
* This is an implementation by me
+ * A method to do this bassically an Array with large bytes allocated to it
*
* */
-sealed Trait MemoryObject {
-
+class MemoryObject {
+
+ object size {
+ val size: Int = 10 * 1024 * 1024
+ }
+
+ val buffer: Vector[size.type] = Vector(1, 1)
}
-class MemoryAllocater {
- /*
- *
- * for stressing the memory we want to do some heavy heap allocations back and forth
- *
- * */
+
+/*
+ * Using java.nio.ByteBuffer
+ * Allocate memory then free memory
+ * for stressing the memory we want to do some heavy heap allocations back and forth
+ *
+ *
+ * */
+
+class MemoryAllocater extends ByteBuffer {
def run(): Unit = println("stressing memory")