Giter VIP home page Giter VIP logo

scala-offheap's Introduction

Type-safe off-heap memory for Scala

Build Status Join the chat at https://gitter.im/densh/scala-offheap

Garbage collection is the standard memory management paradigm on the JVM. In theory, it lets one completely forget about the hurdles of memory management and delegate all of it to the underlying runtime. In practice, GC often leads to scalability issues on large heaps and latency-sensitive workloads.

The goal of this project is to expose a completely different memory management paradigm to the developers: explicitly annotated region-based memory. This paradigm gives more control over memory management without the need to micro-manage allocations.

@data class Dummy(id: Int) {
  def hello: Unit = println(s"Hello, i'm $id")
}

Region { implicit r =>
  for (i <- 1 to 100)
     Dummy(i).hello
}

For example the snippet above allocates 100 objects in a memory region. As long as the region is open, objects are retained in memory and available for access. Once it ends, all of them are efficiently deallocated at once.

Features

  • Efficient scoped region-based memory allocator
  • Optional low-overhead memory sanitizer for debugging and development
  • Offheap classes as a nice typed API for custom data layout
  • Offheap arrays with direct sequential layout in memory
  • Extensibility to accomodate custom memory allocators

Installation

At the moment, there has not been any public releases of scala-offheap. We plan to release an experimental 0.1 release in the near future.

Documentation

Documentation is available at the project's wiki page.

How to contribute

  1. Check the list of open issues and see if you are interested in fixing any of them. If you have encountered a problem or have a feature suggestion feel free to open a new issue.
  2. Fork the main repo and start hacking up the fix. If you have problems with getting started, contact @densh to help you out.
  3. Whenever you fix an issue, add a test that shows that it was indeed fixed. If you introduce a new feature, add a new test suite with a bunch of tests that cover common use cases. If you propose a performance enhancement, include before & after results of a corresponding jmh performance benchmark run in the commit message.
  4. Fire up a pull request. Don't forget to sign the Scala CLA.

scala-offheap's People

Contributors

densh avatar johnmurray avatar ignasi35 avatar 2m avatar

Watchers

James Cloos avatar Jeff Schmitz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.