Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,240
    • Issues 5,240
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 563
    • Merge requests 563
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #18239
Closed
Open
Issue created May 26, 2020 by junji.hashimoto@trac-junji.hashimoto

Non-moving GC does not free nursery area quickly by performGC.

Summary

I am not sure this is a bug.

Our application(hasktorch) manages many c++ objects by ForeignPtr. (hasktorch is FFI of torch.) The pointers are short-lived.

Each c++ object needs large memory area on GPU. The application frequently calls performGC, because I want it released quickly after each epoch.

When we do not use non-moving GC, the area is released by calling performGC soon. Memory usage does not increase.The program finishes in a few minutes.

When we use non-moving GC, the area is not released by calling performGC soon. Memory usage increases, then we can not allocate memory to GPU.

Is there a correct way to force the release of short lived objects?

Steps to reproduce

https://github.com/hasktorch/hasktorch/blob/master/examples/static-mnist-cnn/Main.hs This program runs on CUDA.

I'm sorry I haven't provided an example that can be easily reproduced.

Expected behavior

The program can run without overflow.

Environment

  • GHC version used: 8.10.1

Optional:

  • Operating System: ubuntu 18.04
  • System Architecture: x86_64
Edited May 26, 2020 by junji.hashimoto
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking