Beyond graphics and audio, LWJGL 3 bundles bindings for a wide range of utility libraries: memory allocators, compression codecs, a high-speed database, developer profiling and debugging tools, and the LLVM compiler infrastructure. These bindings are individually optional and carry no mutual dependencies unless noted.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/LWJGL/lwjgl3/llms.txt
Use this file to discover all available pages before exploring further.
The current stable release is 3.4.2. Use the LWJGL build configurator to generate Maven or Gradle dependency declarations for the exact bindings you need.
Memory Allocators
LWJGL’s core module providesMemoryUtil and BufferUtils built on sun.misc.Unsafe / the FFM API, but these specialized allocators offer performance advantages for allocation-heavy workloads.
jemalloc
org.lwjgl:lwjgl-jemalloc — JEmalloc, JEmallocAllocatorA general-purpose malloc implementation that emphasizes fragmentation avoidance and scalable concurrency. Originally developed for FreeBSD, now used by Firefox and Meta’s production systems. Drop-in replacement for the system allocator with thread-local caching and low fragmentation.rpmalloc
org.lwjgl:lwjgl-rpmalloc — RPmallocA public-domain, cross-platform, lock-free, thread-caching memory allocator with 16-byte alignment guarantees. Designed for high-throughput scenarios with many small, concurrent allocations. Particularly effective on multi-core hardware where per-thread caches eliminate most synchronization overhead.| Feature | jemalloc | rpmalloc |
|---|---|---|
| License | BSD-2-Clause | Public domain |
| Thread caching | Yes | Yes (lock-free) |
| Fragmentation control | Excellent | Good |
| Alignment guarantee | Platform default | 16-byte minimum |
| Best for | Long-running apps with mixed allocation sizes | High-frequency small allocations on many threads |
Compression
LZ4
org.lwjgl:lwjgl-lz4 — LZ4, LZ4Frame, LZ4HCAn extremely fast lossless compression algorithm focused on compression and decompression speed, not maximum ratio. LZ4 achieves decompression rates exceeding RAM bandwidth — ideal for real-time asset streaming, network packet compression, and in-memory caches where latency matters more than ratio.Zstandard
org.lwjgl:lwjgl-zstd — Zstd, ZstdDecompressCtx, ZstdCompressCtxA fast lossless compression algorithm from Meta targeting real-time scenarios at zlib-level or better compression ratios. Zstandard supports dictionary compression (dramatically improving ratio for many small, similar assets) and a streaming API for large files.| Metric | LZ4 | Zstandard |
|---|---|---|
| Compression speed | Extremely fast | Fast |
| Decompression speed | Extremely fast | Very fast |
| Compression ratio | Moderate | High (comparable to zlib or better) |
| Dictionary support | Limited | Excellent |
| Best for | Real-time streaming, low-latency caches | Asset packing, network payloads, save files |
Image Codecs
libspng
Maven artifact:org.lwjgl:lwjgl-spngKey classes:
LibSPNG, SpngCtx
libspng (simple PNG) is a C library for reading and writing PNG files with a strong focus on security and ease of use. It is significantly faster than libpng for decoding and passes the full PNG test suite.
If you need to load multiple image formats (JPEG, BMP, TGA) in addition to PNG, prefer stb_image (
org.lwjgl:lwjgl-stb) for its breadth. Use libspng when PNG decode performance or strict spec conformance is the priority.Data and Databases
LMDB
Maven artifact:org.lwjgl:lwjgl-lmdbKey classes:
LMDB, MDBEnv, MDBDbi, MDBTxn, MDBVal
LMDB (Lightning Memory-Mapped Database) is an extraordinarily fast, memory-efficient key-value database. By memory-mapping files, it achieves the read performance of a pure in-memory database while retaining the persistence of a disk-based store. It uses a copy-on-write B-tree with ACID transactions and MVCC (Multi-Version Concurrency Control).
Key characteristics:
| Property | Value |
|---|---|
| Data model | Ordered key-value (B-tree) |
| Transactions | ACID, MVCC (multiple concurrent readers, one writer) |
| API model | Zero-copy — keys and values are pointers into the mmap |
| Max databases per environment | Configurable (default 1) |
| Max readers | Configurable (default 126) |
| License | OpenLDAP Public License |
ODBC
Maven artifact:org.lwjgl:lwjgl-odbcKey classes:
SQL, SQLH, SQLTypes
ODBC (Open Database Connectivity) is the standard C-language interface for accessing relational databases. The LWJGL binding exposes the Windows ODBC API, enabling Java applications to connect to SQL Server, Oracle, PostgreSQL (via ODBC driver), and any other ODBC-compliant data source without a JDBC driver.
Developer Tools
Remotery
org.lwjgl:lwjgl-remotery — RemoteryA real-time CPU and GPU profiler implemented in a single C file. Remotery streams profiling data over WebSockets to a viewer running in any web browser — no installation required on the target machine. Supports OpenGL, Direct3D 11/12, Vulkan, and Metal GPU timers.RenderDoc
org.lwjgl:lwjgl-renderdoc — RenderDocProgrammatic API for the RenderDoc GPU frame debugger. Lets your application trigger frame captures, set capture keys, and launch the RenderDoc replay UI from code — useful for automated graphics regression testing and in-app debugging shortcuts.Hash Algorithms
xxHash
Maven artifact:org.lwjgl:lwjgl-xxhashKey classes:
XXHash, XXH32State, XXH64State, XXH3State
xxHash is an extremely fast, non-cryptographic hash algorithm that runs at RAM speed limits. It is significantly faster than CRC32, MurmurHash, and FNV while maintaining excellent distribution quality.
| Variant | Width | Notes |
|---|---|---|
XXHash.XXH32 | 32-bit | Fastest on 32-bit targets |
XXHash.XXH64 | 64-bit | Fastest on 64-bit targets |
XXHash.XXH3_64bits | 64-bit | Best overall: faster than XXH64 with better avalanche |
XXHash.XXH3_128bits | 128-bit | Highest quality; same speed as XXH3_64 |
System Information
hwloc
Maven artifact:org.lwjgl:lwjgl-hwlocKey classes:
HWLoc, HWLocTopology, HWLocObject
hwloc (Portable Hardware Locality) provides a portable abstraction of the hierarchical topology of modern hardware: NUMA memory nodes, CPU sockets, shared L1/L2/L3 caches, cores, and hardware threads (SMT). It can also query PCI devices, GPUs, and network interfaces.
Use cases:
- Binding threads to specific cores or NUMA nodes for cache-aware parallelism
- Determining the number of physical cores versus logical threads
- Querying GPU/CPU proximity for optimal OpenCL or CUDA device selection
- Building topology-aware work-stealing thread pools
Compiler Infrastructure
LLVM
Maven artifact:org.lwjgl:lwjgl-llvmKey classes:
LLVM, LLVMCore, LLVMBitReader, LLVMBitWriter, LLVMExecutionEngine, LLVMOrcJIT
LLVM is a collection of modular and reusable compiler and toolchain technologies. The LWJGL binding exposes the LLVM C API, covering IR construction, optimization passes, bitcode reading/writing, and JIT compilation via the ORC JIT engine.
Capabilities exposed:
| Module | Description |
|---|---|
LLVMCore | IR builder: modules, functions, basic blocks, instructions |
LLVMBitReader / LLVMBitWriter | Read and write LLVM bitcode (.bc) files |
LLVMAnalysis | Verifier and analysis passes |
LLVMTransforms* | Optimization passes (instcombine, mem2reg, vectorize, etc.) |
LLVMExecutionEngine | MCJIT-based JIT compilation |
LLVMOrcJIT | Modern ORC JIT v2 — lazy compilation, symbol linking |
LLVMTarget* | Code generation for x86, ARM, AArch64, RISC-V, WebAssembly |
Foreign Function Interface
libffi
Maven artifact:org.lwjgl:lwjgl-libffiKey classes:
LibFFI, FFICIF, FFIType, FFIClosure
libffi provides a portable, high-level interface to various C calling conventions. It lets you call arbitrary C functions described at runtime (without compile-time bindings) and create “closures” — native function pointers that, when called from C, invoke Java code.
Primary use cases in LWJGL:
- Implementing runtime-defined callbacks for C libraries that require function pointer parameters
- Calling native APIs that are not yet covered by an LWJGL binding, without writing JNI
- Building dynamic language runtimes or plugin systems that call native code
libffi is a building block for LWJGL’s own callback infrastructure. For most use cases, the higher-level callback classes generated per-binding (e.g.,
GLFWKeyCallbackI, ALCErrorCallback) are easier to use than raw libffi closures.