Skip to content

Cache grows when not using enableSingleSchemaCache #4247

Closed
@flovilmart

Description

@flovilmart

Issue Description

It has been observer that the new caching mechanism (LRUCache) would not prune proactively it's cache after a certain amount of time, leading to memory growth and explosion.

Steps to reproduce

  • Startup a parse-server, without enableSingleSchemaCache
  • use heapdump through require('heapdump') in your startup script
  • notice that the memory keeps growing after each request.

Expected Results

Memory usage should somewhat remain constant, unused data should not be kept indefinitely.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : >= 2.5.1
    • Operating System: n/a
    • Hardware: n/a
    • Localhost or remote server? local
  • Database

    • MongoDB version: n/a
    • Storage engine: n/a
    • Hardware: n/a
    • Localhost or remote server? n/a

Logs/Trace

See discussion over: #4235

Suggested resolution:

1- make singleSChemaCache default (this should be pretty harmless)
2- actively cleanup upon response end the schema cache used for the request
3- actively prune LRU cache dropping older values periodically

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions