[v.1.4] PoolerPlus | Advanced Object Pooling

GET IT HERE!!! FOR FREE!: Module Link


An advanced object pooling system with a large amount of useful features. This module is intended for games that create many parts or GUI objects at once, such as combat or tower defense games.

What is object pooling?

Rather than using multiple instance.new calls on an object which is created multiple times, you can instead save that object’s values to the pooler and return it once, saving you a ton of memory especially if you make a lot of instance.new calls. This module in specific provides 10-50x reduction in object creation memory consumption!

IMPORTANT MODULE FEATURES:

Features
  • High-performance object pooling with 95%+ hit rates (many times staying at 100% during benchmarks)
  • Analytics and performance monitoring
  • Automatic memory pressure management and optimization
  • Smart garbage collection integration
  • Real-time validation and health checking
  • Batch operations for bulk object management
  • Priority-based object allocation
  • Adaptive preloading based on usage patterns
  • Comprehensive debugging and export tools
  • Fully type checked and errorless if handled properly

MODULE USAGE:

Core Methods
  • CreatePool() - Creates a pool
  • Get() – Get object from pool
  • GetSafe() – Safe get with error handling
  • GetWithPriority() – Priority-based allocation
  • GetBatch(count) – Get multiple objects
  • Return() – Return object to pool
  • ReturnBatch() – Return multiple objects
  • ReturnAll() – Return all in-use objects
  • Preload(count) – Pre-create objects
  • AdaptivePreload() – Smart preloading
  • Clear() – Destroy all objects
Optimization And Memory
  • GetMemoryPressure() → “none” | “moderate” | “critical”
  • Optimize() – Memory optimization (per pool)
  • OptimizeWithGC() – Optimization with GC hints (per pool)
  • OptimizeAllPools() – Memory optimization (all pools)
  • OptimizeAllPoolsWithGC() – Optimization with GC hints (all pools)
Analytics and Monitoring
  • GetStats() – Basic statistics
  • GetEnhancedStats() – Detailed analytics
  • GetStatus() – Returns the status of your pool
  • GetActiveObjects() – Currently in-use objects
  • Validate() – Health check
  • SerializeState() – Export state as JSON
Global Utilities
  • GetGlobalStats() – Returns quick statistics
  • GetGlobalEnhancedStats() – Calculates global memory efficiency
  • GetSystemStatus() – Returns many statuses provided by PoolerPlus
  • ValidateAllPools() – Validates all existing pools
  • HealthCheck() – Returns an extensive health report
  • AutoRepairAllPools() – Removes orphan instances
  • EmergencyCleanup() – Force aggressive cleanup
Debug and Performance
  • DebugPrintAllPools() – Comprehensive debug output
  • GetPerformanceReport() – Detailed performance analysis
  • ExportPoolStates() – Full system export
Configuration

PoolConfig = {
maxSize?: number, – Maximum objects in pool (default: unlimited)
preloadCount?: number, – Objects to create initially (default: 0)
enableAnalytics?: boolean, – Track detailed statistics (default: false)
enableAdaptivePreload?: boolean, – Auto-adjust pool size (default: false)
enableValidation?: boolean, – Health monitoring (default: false)
instanceConfig?: { – For Roblox Instance objects:
template?: Instance, – Template for property reset
resetProperties?: {string}, – Specific properties to reset
cleanupConnections?: boolean, – Auto-cleanup script connections
safeParent?: Instance – Safe storage location
}
}

Performance Tests: (feel free to test on your own, results will not differ!)

TL:DR: with PoolerPlus, there’s a 13x decrease in total object creation based memory usage per rotation from the data on my tests which consisted of creating table objects every 0.2-0.5 seconds over a 5+ minute period. The pooled version maintained 95%+ hit rates while the non-pooled version had to create fresh objects every time, resulting in dramatically higher memory allocation. This translates to better performance, reduced garbage collection pressure, and more stable frame rates in production games.

My tests: (note, each rotation is only 10 seconds apart)

PoolerPlus (total memory consumption) Standard Roblox Practice (total memory consumption)
2.5KB 32.3KB
2.5KB 64.8KB
2.6KB 101.2KB

if you find any bugs, please leave a comment! you’ll be credited if you find something notable.

21 Likes

Stumble upon this and used it for my game where it generates probably close to 100 images, destroying and creating.

I was able to get it to work to reuse images instead of recreating it.

Would you be able to put out a tutorial? I find this interesting and want to have a better understanding of it.

I’m mostly curious about how I can go about being able to see the difference in the performance.

Thanks.

Is there any example on how to use this, it is a bit confusing on trying to Pool let’s say 10000 Parts

1 Like

Do you have roblox file or roblox place for the example uses?