Skip to content

Possible Memoryleak with k shortest path #9333

@hr-alebel

Description

@hr-alebel

Describe the bug

We are currently making a PoC of an App using dGraph as the graphdb. We will have a heavy usage of the k-shortest-path method.

Dataset is ~9000 nodes with 600000 edges, with barely any data in predicates.

While testing it with a sample dataset we found that our k8s nodes went out of memory when using anything, but k=1.

After even more debugging and testing different setups (and increasing resources on the nodes) we found the following:

A) using k=1 and no weights in facets -> dGraph behaves normal (normal = query is very fast ~1sec and memory footprint is low ~512MB)

B) using k=1 and weights in facets -> dGraph behaves same as A

C) using k>1 and no weights on facets -> dGraph gets a bit slower ~2sec for numpath 100 and uses slightly more memory, but very much in acceptable ranges

D) using k>1 and weights in facets -> dGraph eventually crashes with OOM while using >8GB of RAM

To Reproduce

Steps to reproduce the behavior:

  1. Create a dataset with ~9000 nodes with ~600000 edges in between them with a float facet that will be used for weights
  2. Create Queries for scenarios A-D
  3. observe memory footprint

Expected behavior

Looking at the code, the aproximate resource usage between scenario C and D should be somewhat similar, in our case ~1GB of RAM and return the answer in a reasonable time

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions