{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/firecracker/json-schema/firecracker-balloon-stats-schema.json",
  "title": "BalloonStats",
  "description": "Describes the balloon device statistics.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/firecracker-balloon-api-openapi.yml#/components/schemas/BalloonStats",
  "type": "object",
  "required": [
    "target_pages",
    "actual_pages",
    "target_mib",
    "actual_mib"
  ],
  "properties": {
    "target_pages": {
      "description": "Target number of pages the device aims to hold.",
      "type": "integer"
    },
    "actual_pages": {
      "description": "Actual number of pages the device is holding.",
      "type": "integer"
    },
    "target_mib": {
      "description": "Target amount of memory (in MiB) the device aims to hold.",
      "type": "integer"
    },
    "actual_mib": {
      "description": "Actual amount of memory (in MiB) the device is holding.",
      "type": "integer"
    },
    "swap_in": {
      "description": "The amount of memory that has been swapped in (in bytes).",
      "type": "integer",
      "format": "int64"
    },
    "swap_out": {
      "description": "The amount of memory that has been swapped out to disk (in bytes).",
      "type": "integer",
      "format": "int64"
    },
    "major_faults": {
      "description": "The number of major page faults that have occurred.",
      "type": "integer",
      "format": "int64"
    },
    "minor_faults": {
      "description": "The number of minor page faults that have occurred.",
      "type": "integer",
      "format": "int64"
    },
    "free_memory": {
      "description": "The amount of memory not being used for any purpose (in bytes).",
      "type": "integer",
      "format": "int64"
    },
    "total_memory": {
      "description": "The total amount of memory available (in bytes).",
      "type": "integer",
      "format": "int64"
    },
    "available_memory": {
      "description": "An estimate of how much memory is available (in bytes) for starting new applications, without pushing the system to swap.",
      "type": "integer",
      "format": "int64"
    },
    "disk_caches": {
      "description": "The amount of memory, in bytes, that can be quickly reclaimed without additional I/O. Typically these pages are used for caching files from disk.",
      "type": "integer",
      "format": "int64"
    },
    "hugetlb_allocations": {
      "description": "The number of successful hugetlb page allocations in the guest.",
      "type": "integer",
      "format": "int64"
    },
    "hugetlb_failures": {
      "description": "The number of failed hugetlb page allocations in the guest.",
      "type": "integer",
      "format": "int64"
    },
    "oom_kill": {
      "description": "OOM killer invocations, indicating critical memory pressure.",
      "type": "integer",
      "format": "int64"
    },
    "alloc_stall": {
      "description": "Counter of Allocation enter a slow path to gain more memory page. The reclaim/scan metrics can reveal what is actually happening.",
      "type": "integer",
      "format": "int64"
    },
    "async_scan": {
      "description": "Amount of memory scanned asynchronously.",
      "type": "integer",
      "format": "int64"
    },
    "direct_scan": {
      "description": "Amount of memory scanned directly.",
      "type": "integer",
      "format": "int64"
    },
    "async_reclaim": {
      "description": "Amount of memory reclaimed asynchronously.",
      "type": "integer",
      "format": "int64"
    },
    "direct_reclaim": {
      "description": "Amount of memory reclaimed directly.",
      "type": "integer",
      "format": "int64"
    }
  }
}