Off heap golang memory pool

Related tags

stealthpool
Overview

Stealthpool

Build Status Go Report Card Go Reference

stealthpool provides a memory pool that allocates blocks off-heap that will NOT be tracked by the garbage collector. The name stealthpool comes from the fact that the memory being allocated by the pool is stealthy and will not be garbage collected ever These blocks should be used in situations where you want to keep garbage collection to a bare minimum. Needless to say, since the GC will not track any of the memory, extreme care must be had in order to avoid memory leaks

Installation

go get -u github.com/Link512/stealthpool

Getting started

// initialize a pool which will allocate a maximum of 100 blocks
pool, err := stealthpool.New(100)
defer pool.Close() // ALWAYS close the pool unless you're very fond of memory leaks

// initialize a pool with custom block size and preallocated blocks
poolCustom, err := stealthpool.New(100, stealthpool.WithBlockSize(8*1024), stealthpool.WithPreAlloc(100))
defer poolCustom.Close() // ALWAYS close the pool unless you're very fond of memory leaks


block, err := poolCustom.Get()
// do some work with block
// then return it exactly as-is to the pool
err = poolCustom.Return(block)

Docs

Go docs together with examples can be found here

Issues
  • Add windows support

    Add windows support

    opened by Link512 0
  • fix build tag

    fix build tag

    According to https://golang.org/cmd/go/#hdr-Build_constraints

    A build constraint is evaluated as the OR of space-separated options. Each option evaluates as the AND of its comma-separated terms. A file may have multiple build constraints. The overall constraint is the AND of the individual constraints.

    So, if alloc_unix.go can't be compiled on both windows and appengine, we should use

    // +build !windows,!appengine
    

    to express

    (NOT windows) AND (NOT appengine)
    
    opened by vcheckzen 0
Minimalistic and High-performance goroutine worker pool written in Go

pond Minimalistic and High-performance goroutine worker pool written in Go Motivation This library is meant to provide a simple way to limit concurren

Alejandro Durante 252 Jul 25, 2021
gpool - a generic context-aware resizable goroutines pool to bound concurrency based on semaphore.

gpool - a generic context-aware resizable goroutines pool to bound concurrency. Installation $ go get github.com/sherifabdlnaby/gpool import "github.c

Sherif Abdel-Naby 80 Jul 4, 2021
:speedboat: a limited consumer goroutine or unlimited goroutine pool for easier goroutine handling and cancellation

Package pool Package pool implements a limited consumer goroutine or unlimited goroutine pool for easier goroutine handling and cancellation. Features

Go Playgound 628 Jul 25, 2021
Go simple async worker pool

??‍?? worker-pool Go simple async worker pool. ?? ABOUT Worker pool is a software design pattern for achieving concurrency of task execution. Maintain

Rafał Lorenz 77 Jul 14, 2021
Off heap golang memory pool

Stealthpool stealthpool provides a memory pool that allocates blocks off-heap that will NOT be tracked by the garbage collector. The name stealthpool

null 43 Jul 19, 2021
A goroutine pool for Go

Tunny is a Golang library for spawning and managing a goroutine pool, allowing you to limit work coming from any number of goroutines with a synchrono

Ashley Jeffs 2.5k Jul 21, 2021
Lightweight Goroutine pool

grpool Lightweight Goroutine pool Clients can submit jobs. Dispatcher takes job, and sends it to first available worker. When worker is done with proc

Ivan Pusic 645 Jul 23, 2021
🐝 A Highly Performant and easy to use goroutine pool for Go

gohive Package gohive implements a simple and easy to use goroutine pool for Go Features Pool can be created with a specific size as per the requireme

Lovelesh 12 Jun 21, 2021
Golang simple thread pool implementation

Golang Threadpool implementation Scalable threadpool implementation using Go to handle the huge network trafic. Install go get github.com/shettyh/thre

Manjunath Shetty 60 Jun 6, 2021
golang worker pool , Concurrency limiting goroutine pool

golang worker pool 中文说明 Concurrency limiting goroutine pool. Limits the concurrency of task execution, not the number of tasks queued. Never blocks su

xxj 307 Jul 20, 2021
高性能go协程池,代码清晰易懂

gowp 高性能go协程池,代码清晰易懂 安装 go get github.com/linzhepeng/gowp 为什么要用协程池 go的协程虽然轻量级,单个goroutine只有2KB,但毫无止境地使用也会占据大量的系统资源,导致调度性能下降、GC 频繁、内存暴涨, 引发一系列问题。 可以测试如

Bing 3 May 5, 2021
Concurrency limiting goroutine pool

workerpool Concurrency limiting goroutine pool. Limits the concurrency of task execution, not the number of tasks queued. Never blocks submitting task

Andrew Gillis 584 Jul 19, 2021
Reactive Extensions for the Go language.

RxGo Reactive Extensions for the Go Language ReactiveX ReactiveX, or Rx for short, is an API for programming with Observable streams. This is the offi

ReactiveX 3.7k Jul 20, 2021
errgroup with goroutine worker limits

neilotoole/errgroup neilotoole/errgroup is a drop-in alternative to Go's wonderful sync/errgroup but limited to N goroutines. This is useful for inter

Neil O'Toole 82 Jul 20, 2021