Search in sources :

Example 11 with MemoryPools

use of org.neo4j.memory.MemoryPools in project neo4j by neo4j.

the class HeapTrackingLongObjectHashMapTest method setUp.

@BeforeEach
void setUp() {
    memoryPool = new MemoryPools().pool(MemoryGroup.TRANSACTION, 0L, null);
    memoryTracker = new LocalMemoryTracker(memoryPool);
}
Also used : MemoryPools(org.neo4j.memory.MemoryPools) LocalMemoryTracker(org.neo4j.memory.LocalMemoryTracker) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 12 with MemoryPools

use of org.neo4j.memory.MemoryPools in project neo4j by neo4j.

the class HeapTrackingUnifiedIdentityHashingSetTest method setUp.

@BeforeEach
void setUp() {
    memoryPool = new MemoryPools().pool(MemoryGroup.TRANSACTION, 0L, null);
    memoryTracker = new LocalMemoryTracker(memoryPool);
}
Also used : MemoryPools(org.neo4j.memory.MemoryPools) LocalMemoryTracker(org.neo4j.memory.LocalMemoryTracker) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 13 with MemoryPools

use of org.neo4j.memory.MemoryPools in project neo4j by neo4j.

the class HeapTrackingUnifiedSetTest method setUp.

@BeforeEach
void setUp() {
    memoryPool = new MemoryPools().pool(MemoryGroup.TRANSACTION, 0L, null);
    memoryTracker = new LocalMemoryTracker(memoryPool);
}
Also used : MemoryPools(org.neo4j.memory.MemoryPools) LocalMemoryTracker(org.neo4j.memory.LocalMemoryTracker) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 14 with MemoryPools

use of org.neo4j.memory.MemoryPools in project neo4j by neo4j.

the class HeapTrackingIntObjectHashMapTest method setUp.

@BeforeEach
void setUp() {
    memoryPool = new MemoryPools().pool(MemoryGroup.TRANSACTION, 0L, null);
    memoryTracker = new LocalMemoryTracker(memoryPool);
}
Also used : MemoryPools(org.neo4j.memory.MemoryPools) LocalMemoryTracker(org.neo4j.memory.LocalMemoryTracker) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 15 with MemoryPools

use of org.neo4j.memory.MemoryPools in project neo4j by neo4j.

the class BoltMemoryPoolIT method reportConsumedDirectMemory.

@Test
void reportConsumedDirectMemory() {
    var bufAllocator = createTestAllocator(true);
    var allocatorMetric = bufAllocator.metric();
    assertEquals(0, allocatorMetric.usedDirectMemory());
    assertEquals(0, allocatorMetric.usedDirectMemory());
    var memoryTracker = new BoltMemoryPool(new MemoryPools(), allocatorMetric);
    var buffer = bufAllocator.buffer(requestedSize);
    try {
        assertEquals(requestedSize, buffer.capacity());
        assertEquals(requestedSize, memoryTracker.usedNative());
        assertEquals(requestedSize, memoryTracker.totalUsed());
    } finally {
        buffer.release();
    }
    assertEquals(0, memoryTracker.usedNative());
    assertEquals(0, memoryTracker.totalUsed());
}
Also used : MemoryPools(org.neo4j.memory.MemoryPools) Test(org.junit.jupiter.api.Test)

Aggregations

MemoryPools (org.neo4j.memory.MemoryPools)19 BeforeEach (org.junit.jupiter.api.BeforeEach)9 LocalMemoryTracker (org.neo4j.memory.LocalMemoryTracker)8 Test (org.junit.jupiter.api.Test)7 PageCache (org.neo4j.io.pagecache.PageCache)6 ConfiguringPageCacheFactory (org.neo4j.kernel.impl.pagecache.ConfiguringPageCacheFactory)5 JobScheduler (org.neo4j.scheduler.JobScheduler)5 Config (org.neo4j.configuration.Config)4 IOException (java.io.IOException)2 ConsistencyCheckService (org.neo4j.consistency.ConsistencyCheckService)2 Lifespan (org.neo4j.kernel.lifecycle.Lifespan)2 DirectoryNotEmptyException (java.nio.file.DirectoryNotEmptyException)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 List (java.util.List)1 Stream (java.util.stream.Stream)1 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)1 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)1 Assertions.assertFalse (org.junit.jupiter.api.Assertions.assertFalse)1