HCOLL-217 Add Deflator compression for JDK Serialized values.

This commit is contained in:
Peter Lawrey
2014-11-26 08:01:34 +02:00
parent 03ebc45299
commit ccf42248a1
5 changed files with 21 additions and 17 deletions
@@ -36,7 +36,7 @@ public class OSResizesMain {
public static void main(String[] args) throws IOException, InterruptedException {
File file = File.createTempFile("over-sized", "deleteme");
ChronicleMap<String, String> map = ChronicleMapBuilder.of(String.class, String.class)
.entrySize(100 * 1024 * 1024)
.entrySize(50 * 1024 * 1024)
.entries(1000 * 1000)
.createPersistedTo(file);
for (int i = 0; i < 10000; i++) {
@@ -44,6 +44,10 @@ public class OSResizesMain {
Arrays.fill(chars, '+');
map.put("key-" + i, new String(chars));
}
long start = System.currentTimeMillis();
System.gc();
long time0 = System.currentTimeMillis() - start;
System.out.printf("GC time: %,d ms%n", time0);
System.out.printf("System memory: %.1f GB, Extents of map: %.1f GB, disk used: %sB, addressRange: %s%n",
Double.parseDouble(run("head", "-1", "/proc/meminfo").split("\\s+")[1]) / 1e6,
file.length() / 1e9,
@@ -51,7 +55,7 @@ public class OSResizesMain {
run("grep", "over-sized", "/proc/" + Jvm.getProcessId() + "/maps").split("\\s")[0]);
// show up in top.
long time = System.currentTimeMillis();
while (time + 20000 > System.currentTimeMillis())
while (time + 30000 > System.currentTimeMillis())
Thread.yield();
map.close();
file.delete();
@@ -18,7 +18,7 @@
package net.openhft.chronicle.map;
import net.openhft.lang.io.serialization.JDKObjectSerializer;
import net.openhft.lang.io.serialization.JDKZObjectSerializer;
import org.junit.Test;
import java.io.*;
@@ -35,7 +35,7 @@ public class RecursiveRefereneChMapTest {
file.deleteOnExit();
Map<String, StupidCycle> map = ChronicleMapBuilder.of(String.class, StupidCycle.class)
.entries(64)
.objectSerializer(JDKObjectSerializer.INSTANCE).create();
.objectSerializer(JDKZObjectSerializer.INSTANCE).create();
map.put("Test", new StupidCycle());
map.put("Test2", new StupidCycle2());
StupidCycle cycle = (StupidCycle) map.get("Test");