Skip to content

This module provides utilities for managing memory in your application, * including a global `MemoryManager` that handles periodic memory checks * and clears registered `CacheManager` instances when memory is low.

License

Notifications You must be signed in to change notification settings

stSoftwareAU/MemoryManagerTS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memory Management Library

A TypeScript library designed for efficient memory management, providing tools for handling in-memory caching, periodic memory checks, and automatic cache clearing. This library includes two primary components: MemoryManager and MemoryHandler.

Features

  • Singleton MemoryManager: Manages multiple cache handlers and periodically checks memory usage.
  • MemoryHandler Interface: Defines the required structure for classes that need to manage their memory usage.
  • Automatic Cache Clearing: Clears cache when memory usage exceeds a defined threshold.
  • Support for Deno: Fully compatible with Deno, including non-blocking intervals via Deno.unrefTimer.

Getting Started

Prerequisites

JSR

Installation

Since this project is intended for use with Deno, you can import it directly from your project without needing additional installation:

import { MemoryManager, MemoryHandler } from "./src/mod.ts";

About

This module provides utilities for managing memory in your application, * including a global `MemoryManager` that handles periodic memory checks * and clears registered `CacheManager` instances when memory is low.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published