<commit_before>package org.umlg.sqlg.test.memory;

import org.apache.tinkerpop.gremlin.structure.T;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.umlg.sqlg.test.BaseTest;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * Date: 2016/05/15
 * Time: 8:22 AM
 */
public class TestMemoryUsage extends BaseTest {

    @Before
    public void beforeTest() {
        Assume.assumeTrue(this.sqlgGraph.getSqlDialect().supportsBatchMode());
    }

    @Test
    public void testMemoryUsage() throws InterruptedException {
        this.sqlgGraph.tx().streamingBatchModeOn();
        for (int i = 0; i < 1_000_000; i++) {
            this.sqlgGraph.streamVertex(T.label, "A", "name", "a" + i);
        }
        this.sqlgGraph.tx().commit();
        System.gc();
        Thread.sleep(3000);
        assertEquals(1_000_000, this.sqlgGraph.traversal().V().count().next(), 0);
        System.gc();
        Thread.sleep(3000);
        assertTrue(Runtime.getRuntime().freeMemory() < 731_082_048);
    }
}<commit_msg>increase memory test limit<commit_after>package org.umlg.sqlg.test.memory;

import org.apache.tinkerpop.gremlin.structure.T;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.umlg.sqlg.test.BaseTest;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * Date: 2016/05/15
 * Time: 8:22 AM
 */
public class TestMemoryUsage extends BaseTest {

    @Before
    public void beforeTest() {
        Assume.assumeTrue(this.sqlgGraph.getSqlDialect().supportsBatchMode());
    }

    @Test
    public void testMemoryUsage() throws InterruptedException {
        this.sqlgGraph.tx().streamingBatchModeOn();
        for (int i = 0; i < 1_000_000; i++) {
            this.sqlgGraph.streamVertex(T.label, "A", "name", "a" + i);
        }
        this.sqlgGraph.tx().commit();
        System.gc();
        Thread.sleep(3000);
        assertEquals(1_000_000, this.sqlgGraph.traversal().V().count().next(), 0);
        System.gc();
        Thread.sleep(3000);
        assertTrue(Runtime.getRuntime().freeMemory() < 1_000_000_000);
    }
}
{'fraction_non_alphanumeric': 0.1439706556625401, 'fraction_numerical': 0.040806969280146724, 'mean_word_length': 3.132575757575758, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5528700', 'n_tokens_mistral': 778, 'n_tokens_neox': 704, 'n_words': 127}