Uploaded image for project: 'Spring Data REST'
  1. Spring Data REST
  2. DATAREST-1505

In case of low memory after GC all repository mappings are removed and 404 is returned

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When an application with Spring Data Rest will be low on memory repository mappings will be cleared and never recreated. It will cause 404 on every data rest endpoint.

       

      To reproduce:

      1. Start app
      2. Consume memory, but not too much (before Out of memory exception)
      3. Observe when 404 will start to appear

      PersistentEntitiesResourceMappings have a cache with ConcurrentReferenceHashMap with Soft References as default. 

      If GC will run out of memory those refs will be cleared without any notice and never recreated (until restart).

       

      I think it is better to have in this place Out Of Memory exception than have disappearing endpoints and still working app. 

       

      Please see the sample project with fixed 64MB xmx.

      https://github.com/iwan41/spring-data-rest-gc-problem

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              olivergierke Oliver Drotbohm
              Reporter:
              iwan41 iwan41
              Last updater:
              iwan41
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: