Neo4j 3.5 Java embedded. How to increase heap size?












2















When using Neo4j embedded with Java how do I increase the size of the heap past 2 gigabytes?



I tried to increase it to 4 Gigabytes using



GraphDatabaseService graphDb = new GraphDatabaseFactory()
.newEmbeddedDatabaseBuilder(new File("C:\...\graph.db"))
.setConfig(GraphDatabaseSettings.pagecache_memory, "4096M")
.newGraphDatabase();


as noted in manual but this appears to have no effect on the size of the heap, e.g.

Max: 2,124,414,976 B in image below.



enter image description here





Details



In doing a uniform cost search or lowest cost first search requires retaining




  1. A list of each node visited

  2. A queue of the cost for each relationship not processed


In using Neo4j embedded with Java the application ends with



java.lang.OutOfMemoryError: GC overhead limit exceeded


To monitor the application running it is run with IntelliJ Community 2018.3 in debug mode with Visual VM 1.4.2.



The IntelliJ Plugin VisualVM Launcher is installed.



enter image description here





EDIT



This helps get past the problem for testing but still does not answer the question. It is posted here so that it can help others that find this question.



While I currently can not find a way increase the heap size for the JVM when creating a Neo4j graph with the Neo4j Java API, e.g.



new GraphDatabaseFactory()


or



new EnterpriseGraphDatabaseFactory()


when testing using IntelliJ



by creating the graph using



GraphDatabaseService graphDb = new GraphDatabaseFactory()
.newEmbeddedDatabase(new File("C:\...\graph.db"));


and using the Intellj Run/Debug Configurations Dialog



enter image description here



and editing VM options by adding the JVM configuration options for starting heap size Xms and maximum heap size Xmx e.g.



-Xms4096m -Xmx4096m


the heap was increased during testing to 4,4294,967,296 B and the program completed as expected.



enter image description here



enter image description here



enter image description here










share|improve this question





























    2















    When using Neo4j embedded with Java how do I increase the size of the heap past 2 gigabytes?



    I tried to increase it to 4 Gigabytes using



    GraphDatabaseService graphDb = new GraphDatabaseFactory()
    .newEmbeddedDatabaseBuilder(new File("C:\...\graph.db"))
    .setConfig(GraphDatabaseSettings.pagecache_memory, "4096M")
    .newGraphDatabase();


    as noted in manual but this appears to have no effect on the size of the heap, e.g.

    Max: 2,124,414,976 B in image below.



    enter image description here





    Details



    In doing a uniform cost search or lowest cost first search requires retaining




    1. A list of each node visited

    2. A queue of the cost for each relationship not processed


    In using Neo4j embedded with Java the application ends with



    java.lang.OutOfMemoryError: GC overhead limit exceeded


    To monitor the application running it is run with IntelliJ Community 2018.3 in debug mode with Visual VM 1.4.2.



    The IntelliJ Plugin VisualVM Launcher is installed.



    enter image description here





    EDIT



    This helps get past the problem for testing but still does not answer the question. It is posted here so that it can help others that find this question.



    While I currently can not find a way increase the heap size for the JVM when creating a Neo4j graph with the Neo4j Java API, e.g.



    new GraphDatabaseFactory()


    or



    new EnterpriseGraphDatabaseFactory()


    when testing using IntelliJ



    by creating the graph using



    GraphDatabaseService graphDb = new GraphDatabaseFactory()
    .newEmbeddedDatabase(new File("C:\...\graph.db"));


    and using the Intellj Run/Debug Configurations Dialog



    enter image description here



    and editing VM options by adding the JVM configuration options for starting heap size Xms and maximum heap size Xmx e.g.



    -Xms4096m -Xmx4096m


    the heap was increased during testing to 4,4294,967,296 B and the program completed as expected.



    enter image description here



    enter image description here



    enter image description here










    share|improve this question



























      2












      2








      2


      1






      When using Neo4j embedded with Java how do I increase the size of the heap past 2 gigabytes?



      I tried to increase it to 4 Gigabytes using



      GraphDatabaseService graphDb = new GraphDatabaseFactory()
      .newEmbeddedDatabaseBuilder(new File("C:\...\graph.db"))
      .setConfig(GraphDatabaseSettings.pagecache_memory, "4096M")
      .newGraphDatabase();


      as noted in manual but this appears to have no effect on the size of the heap, e.g.

      Max: 2,124,414,976 B in image below.



      enter image description here





      Details



      In doing a uniform cost search or lowest cost first search requires retaining




      1. A list of each node visited

      2. A queue of the cost for each relationship not processed


      In using Neo4j embedded with Java the application ends with



      java.lang.OutOfMemoryError: GC overhead limit exceeded


      To monitor the application running it is run with IntelliJ Community 2018.3 in debug mode with Visual VM 1.4.2.



      The IntelliJ Plugin VisualVM Launcher is installed.



      enter image description here





      EDIT



      This helps get past the problem for testing but still does not answer the question. It is posted here so that it can help others that find this question.



      While I currently can not find a way increase the heap size for the JVM when creating a Neo4j graph with the Neo4j Java API, e.g.



      new GraphDatabaseFactory()


      or



      new EnterpriseGraphDatabaseFactory()


      when testing using IntelliJ



      by creating the graph using



      GraphDatabaseService graphDb = new GraphDatabaseFactory()
      .newEmbeddedDatabase(new File("C:\...\graph.db"));


      and using the Intellj Run/Debug Configurations Dialog



      enter image description here



      and editing VM options by adding the JVM configuration options for starting heap size Xms and maximum heap size Xmx e.g.



      -Xms4096m -Xmx4096m


      the heap was increased during testing to 4,4294,967,296 B and the program completed as expected.



      enter image description here



      enter image description here



      enter image description here










      share|improve this question
















      When using Neo4j embedded with Java how do I increase the size of the heap past 2 gigabytes?



      I tried to increase it to 4 Gigabytes using



      GraphDatabaseService graphDb = new GraphDatabaseFactory()
      .newEmbeddedDatabaseBuilder(new File("C:\...\graph.db"))
      .setConfig(GraphDatabaseSettings.pagecache_memory, "4096M")
      .newGraphDatabase();


      as noted in manual but this appears to have no effect on the size of the heap, e.g.

      Max: 2,124,414,976 B in image below.



      enter image description here





      Details



      In doing a uniform cost search or lowest cost first search requires retaining




      1. A list of each node visited

      2. A queue of the cost for each relationship not processed


      In using Neo4j embedded with Java the application ends with



      java.lang.OutOfMemoryError: GC overhead limit exceeded


      To monitor the application running it is run with IntelliJ Community 2018.3 in debug mode with Visual VM 1.4.2.



      The IntelliJ Plugin VisualVM Launcher is installed.



      enter image description here





      EDIT



      This helps get past the problem for testing but still does not answer the question. It is posted here so that it can help others that find this question.



      While I currently can not find a way increase the heap size for the JVM when creating a Neo4j graph with the Neo4j Java API, e.g.



      new GraphDatabaseFactory()


      or



      new EnterpriseGraphDatabaseFactory()


      when testing using IntelliJ



      by creating the graph using



      GraphDatabaseService graphDb = new GraphDatabaseFactory()
      .newEmbeddedDatabase(new File("C:\...\graph.db"));


      and using the Intellj Run/Debug Configurations Dialog



      enter image description here



      and editing VM options by adding the JVM configuration options for starting heap size Xms and maximum heap size Xmx e.g.



      -Xms4096m -Xmx4096m


      the heap was increased during testing to 4,4294,967,296 B and the program completed as expected.



      enter image description here



      enter image description here



      enter image description here







      java neo4j heap-memory uniform-cost-search






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 31 '18 at 16:21







      Guy Coder

















      asked Dec 28 '18 at 16:32









      Guy CoderGuy Coder

      15k43982




      15k43982
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53961536%2fneo4j-3-5-java-embedded-how-to-increase-heap-size%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53961536%2fneo4j-3-5-java-embedded-how-to-increase-heap-size%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas