Sitelet https://github.com/TeamWisp/WispRenderer/issues/387
Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

Memory leaks #387

Description

@Nielsbishere

Is your request related to a problem? Please describe.
There's several memory leaks that result in problems when the maya plugin unloads wips.
This thread will be used to note the findings of the inspection.

Describe the solution you'd like
These instances should be fixed.

Describe alternatives you've considered
N.A.

Additional context
Create an exit callback (call onexit(myCallback)), place a breakpoint on start and in the callback and take 2 snapshots to diff.

Activity

  1. Nielsbishere commented on Jun 18, 2019

    @Nielsbishere
    ContributorAuthor
    // Make sure we free the data objects we allocated.
    for (auto& data : m_data)
    {
    	delete data;
    }

    In frame_graph.hpp Destroy function
    Auto doesn't provide clarity about the type; but the type is void*. This means that it doesn't call free or the destructor of the object.

    Memory impact

    Among the largest left over objects are because of this issue (est. 20%)

  2. Nielsbishere commented on Jun 18, 2019

    @Nielsbishere
    ContributorAuthor

    PhysicsEngine::destroy is never being called, leaving behind bullet's resources.

    Memory impact

    The biggest impact as bullet allocates several memory pools (est. 60%)

  3. Nielsbishere commented on Jun 18, 2019

    @Nielsbishere
    ContributorAuthor

    texture_pool ptr is potentially never reset; leaving behind some memory.

    Memory impact

    Not that much (est. 5%)

  4. Nielsbishere commented on Jun 21, 2019

    @Nielsbishere
    ContributorAuthor
    • aiScene* isn't being cleaned up
    • Viknell probably still has materials left over
    • Sponza probably still has materials left over
  5. Nielsbishere commented on Jun 21, 2019

    @Nielsbishere
    ContributorAuthor
    • Models don't clean up their allocated materials
    • Physics component doesn't clean up the rigid bodies, shapes, etc.
  6. Nielsbishere commented on Jun 21, 2019

    @Nielsbishere
    ContributorAuthor
    • Thread pool enqueue leaks memory
  7. Nielsbishere commented on Jun 21, 2019

    @Nielsbishere
    ContributorAuthor
    • Build acceleration structure task doesn't clean up the CB
  8. Nielsbishere commented on Jun 21, 2019

    @Nielsbishere
    ContributorAuthor

    Possible issues to look into further:
    Left-over data includes; C++ initialization data which should be taken care of by the program finishing unloading. Other than that; file streams seem to have temporary memory that may or may not be deleted after program end.

  9. Nielsbishere commented on Jun 23, 2019

    @Nielsbishere
    ContributorAuthor

    Even though CPU memory leaks are mostly cleaned up, there could potentially still be GPU memory leaks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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