Skip to content
  • Teo Camarasu's avatar
    ea2c6673
    Implement user-defined allocation limit handlers · ea2c6673
    Teo Camarasu authored and Marge Bot's avatar Marge Bot committed
    Allocation Limits allow killing a thread if they allocate more than a
    user-specified limit.
    We extend this feature to allow more versatile behaviour.
    
    - We allow not killing the thread if the limit is exceeded.
    - We allow setting a custom handler to be called when the limit is exceeded.
    
    User-specified allocation limit handlers run in a fresh thread and are passed
    the ThreadId of the thread that exceeded its limit.
    
    We introduce utility functions for getting and setting the allocation
    limits of other threads, so that users can reset the limit of a thread
    from a handler. Both of these are somewhat coarse-grained as we are
    unaware of the allocations in the current nursery chunk.
    
    We provide several examples of usages in testsuite/tests/rts/T22859.hs
    
    Resolves #22859
    ea2c6673
    Implement user-defined allocation limit handlers
    Teo Camarasu authored and Marge Bot's avatar Marge Bot committed
    Allocation Limits allow killing a thread if they allocate more than a
    user-specified limit.
    We extend this feature to allow more versatile behaviour.
    
    - We allow not killing the thread if the limit is exceeded.
    - We allow setting a custom handler to be called when the limit is exceeded.
    
    User-specified allocation limit handlers run in a fresh thread and are passed
    the ThreadId of the thread that exceeded its limit.
    
    We introduce utility functions for getting and setting the allocation
    limits of other threads, so that users can reset the limit of a thread
    from a handler. Both of these are somewhat coarse-grained as we are
    unaware of the allocations in the current nursery chunk.
    
    We provide several examples of usages in testsuite/tests/rts/T22859.hs
    
    Resolves #22859
Loading