Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-11882

SolrMetric registries retain references to SolrCores when closed



    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 7.1
    • 7.4, 8.0
    • metrics, Server
    • None



      Our setup involves using a lot of small cores (possibly hundred thousand), but working only on a few of them at any given time.

      We already followed all recommendations in this guide: https://wiki.apache.org/solr/LotsOfCores

      We noticed that after creating/loading around 1000-2000 empty cores, with no documents inside, the heap consumption went through the roof despite having set transientCacheSize to only 64 (heap size set to 12G).

      All cores are correctly set to loadOnStartup=false and transient=true, and we have verified via logs that the cores in excess are actually being closed.

      However, a reference remains in the org.apache.solr.metrics.SolrMetricManager#registries that is never removed until a core if fully unloaded.

      Restarting the JVM loads all cores in the admin UI, but doesn't populate the ConcurrentHashMap until a core is actually fully loaded.

      I reproduced the issue on a smaller scale (transientCacheSize = 5, heap size = 512m) and made a report (attached) using eclipse MAT.

      Desired outcome:

      When a transient core is closed, the references in the SolrMetricManager should be removed, in the same fashion the reporters for the core are also closed and removed.

      In alternative, a unloadOnClose=true|false flag could be implemented to fully unload a transient core when closed due to the cache size.


      The documentation mentions everywhere that the unused cores will be unloaded, but it's misleading as the cores are never fully unloaded.


        1. SOLR-11882-7x.patch
          110 kB
          Andrzej Bialecki
        2. SOLR-11882.patch
          108 kB
          Andrzej Bialecki
        3. SOLR-11882.patch
          12 kB
          Andrzej Bialecki
        4. SOLR-11882.patch
          2 kB
          Erick Erickson
        5. SOLR-11882.patch
          1 kB
          Erick Erickson
        6. SOLR-11882.patch
          0.7 kB
          Erick Erickson
        7. create-cores.zip
          0.4 kB
          Eros Taborelli
        8. solr.config.zip
          146 kB
          Eros Taborelli
        9. SOLR-11882.patch
          0.7 kB
          Erick Erickson
        10. solr-dump-full_Leak_Suspects.zip
          71 kB
          Eros Taborelli



            ab Andrzej Bialecki
            eros.taborelli Eros Taborelli
            0 Vote for this issue
            8 Start watching this issue