Airframe

Airframe

  • Docs
  • Blog
  • Release Notes
  • GitHub

›Utilities

Resources

  • Overview
  • Articles
  • Release Notes
  • Logos

Framework

  • airframe-di: Dependency Injection
  • Airframe RPC
  • airframe-http: Creating REST Service
  • airframe-rx: ReactiveX interface
  • AirSpec: Testing Framework

Core Modules

  • airframe-codec: Schema-On-Read Object Serializer
  • airframe-config: Application Config Flow
  • airframe-control: Retry/Rate Control
  • airframe-log: Application Logger
  • airframe-metrics: Human-Friendly Measures for Time and Data Size
  • airframe-surface: Object Shape Inspector

Utilities

  • airframe-benchmark: JMH Benchmark
  • airframe-canvas: Off-Heap Memory Manager
  • airframe-fluentd: Fluentd Logger
  • airframe-http-recorder: Web Request/Response Recorder
  • airframe-jdbc: JDBC Connection Pool
  • airframe-jmx: JMX Application Monitor
  • airframe-json: Pure-Scala JSON Parser
  • airframe-launcher: Command-Line Program Launcher
  • airframe-msgpack: Pure-Scala MessagePack Parser
  • airframe-parquet: Parquet Columnar File Reader and Writer
  • airframe-sql: SQL Parser
  • airframe-ulid: ULID Generator

airframe-canvas: Off-Heap Memory Manager

airframe-canvas is a library for managing large off-heap memory (called Canvas) of more than 2G (2^31) size, which is the limit of JVM byte arrays.

With airframe-canvas:

  • You can save the CPU cost of zero-filing when initializing arrays.
  • Off-heap memory canvases are managed outside JVM heap memory, so you can allocate a larger memory region than the value specified with -Xmx JVM option.
  • You can quickly release allocated memory with Canvas.release.
  • Even if you forget to release canvases, the allocated memory can be released upon GC.

airframe-canvas is a successor of xerial/larray.

Usage

Maven Central

build.sbt

libraryDependencies += "org.wvlet.airframe" %% "airframe-canvas" % "(version)"

Canvas object has various factory methods for creating canvas objects from scratch, or based on existing byte arrays (e.g., Array[Byte], ByteBuffer, etc.)

import wvlet.airframe.canvas.Canvas

val c = Canvas.newOffHeapCanvas(512)
c.writeInt(0, 10)
val i = c.readInt(0) // 10

// Release the buffer
c.close()
← airframe-benchmark: JMH Benchmarkairframe-fluentd: Fluentd Logger →
Airframe
Docs
Documentation
Community
Gitter Chat
More
GitHubStar
airframe logo
Copyright © 2024 wvlet.org