Running this code with 2.0-M2 causes my server to throw "2014-10-10 
13:38:16:009 INFO Created database 'petshop' of type 'plocal' 
[ONetworkProtocolBinary]java.lang.OutOfMemoryError: Java heap space", even 
if I only have my pool set to (1,1) instances:

public class O2GraphPool
{
    public static void main(String[] args)
    {
        long start = System.currentTimeMillis();

        Random rand = new Random();
        byte[] blob = new byte[64 * 1024];
        rand.nextBytes(blob);

        OrientGraphFactory factory = new 
OrientGraphFactory("remote:localhost/petshop", "root", "root").setupPool(1, 
1);

        try
        {
            for (int i = 0; i < 10000; i++)
            {
                OrientGraph graph = factory.getTx(); // get an instance 
from the pool
                try
                {
                    graph.begin();

                    Vertex v1 = graph.addVertex(null);
                    v1.setProperty("name", "Luca");
                    v1.setProperty("blob", blob);

                    graph.commit(); // commits transaction
                }
                catch (Exception ex)
                {
                    try
                    {
                        graph.rollback();
                    }
                    catch (Exception ex1)
                    {
                        System.err.println("rollback exception! " + ex);
                    }

                    System.err.println("operation exception! " + ex);
                    ex.printStackTrace(System.err);
                }
                finally
                {
                    graph.shutdown();
                }
            }
        }
        catch (Exception ex)
        {
            System.err.println("instance exception! " + ex);
            ex.printStackTrace(System.err);
        }
        finally
        {
            factory.close();
        }

        System.out.println("done in " + (System.currentTimeMillis() - 
start) + "ms");
    }
}


-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to