Home

>

Tools

>

Ghost

>

Releases

>

2.22.2

Ghost Release: 2.22.2

Tag Name: 2.22.2

Release Date: 5/21/2019

Ghost LogoGhost

Open-source publishing platform specifically designed for professional bloggers and publications. Focuses on clean, minimalist writing and publishing experience.

TL;DR

Ghost 2.22.2 is a maintenance release that addresses a memory leak issue in the JSON schema validation system. This update optimizes how the AJV (Another JSON Validator) library is used by implementing a singleton pattern, which significantly reduces memory consumption during schema validation operations.

Highlight of the Release

    • Fixed memory leak in JSON schema validation
    • Implemented singleton pattern for AJV instance
    • Optimized schema loading and caching

Migration Guide

No migration steps are required for this release. The update is fully backward compatible and can be installed without any additional configuration or code changes.

Upgrade Recommendations

This update is recommended for all Ghost installations, especially those experiencing memory-related issues or running on servers with limited resources. The memory optimization will benefit all Ghost instances regardless of size or traffic volume.

To upgrade:

  1. Back up your Ghost installation
  2. Follow the standard Ghost update procedure for your installation method (CLI, Docker, or manual installation)
  3. No additional configuration is needed after upgrading

Bug Fixes

Memory Leak Fix

Fixed a memory leak in the JSON schema validation system. Previously, the code was creating a new instance of AJV (Another JSON Validator) for each validation call and loading schemas repeatedly, which caused memory to accumulate over time as AJV caches all schemas internally.

The fix implements a singleton pattern that:

  • Uses a single instance of AJV across the application
  • Conditionally loads and compiles schemas only when they haven't been processed before
  • Prevents redundant schema caching that was contributing to the memory leak

New Features

No new features were introduced in this release. This is a maintenance update focused on performance optimization and bug fixing.

Security Updates

No security fixes were included in this release.

Performance Improvements

JSON Schema Validation Optimization

Significantly improved memory usage by refactoring how JSON schema validation works:

  • Replaced multiple AJV instances with a single shared instance
  • Implemented conditional schema loading that prevents duplicate schema compilation
  • Reduced memory footprint during validation operations
  • Improved overall application stability by preventing memory growth over time

This change should be particularly noticeable on busy Ghost instances that perform frequent schema validations.

Impact Summary

This release addresses an important memory leak issue that could affect the stability and performance of Ghost installations over time. By optimizing how JSON schema validation works, Ghost 2.22.2 reduces memory consumption and improves overall system reliability.

While there are no user-facing changes to the Ghost admin interface or content creation experience, server administrators will benefit from improved resource utilization and stability. This is particularly valuable for Ghost installations on shared hosting or environments with limited memory resources.

The technical nature of this fix demonstrates Ghost's commitment to performance optimization and system reliability, ensuring that the platform remains efficient even as sites grow and traffic increases.

Full Release Notes

No user facing changes

You can see the full change log for the details of every change included in this release.

Statistics:

File Changed3
Line Additions16
Line Deletions9
Line Changes25
Total Commits3

User Affected:

  • Reduced memory usage on Ghost instances
  • Improved server stability with fewer memory-related issues
  • No configuration changes required to benefit from the improvement

Contributors:

allouis