Skip to content

Blank page / Out of memory in json_encode($opcache->getData()) #117

@the0ne

Description

@the0ne

Interestingly opcache-gui worked nicely for me on one day but had stopped working "blank page" on the next day.
I found the root cause to be that the call to json_encode fails if the files array has too many entries.

In my case it was 55932 entries which made json_encode fail with a blank page.

Writing this, I realize that what I experience might be a simple oom error.
So I'll now try to increase the available memory and retry.

object(Service)[1]
  protected 'tz' => 
    object(DateTimeZone)[2]
      public 'timezone_type' => int 3
      public 'timezone' => string 'Europe/Berlin' (length=13)
  protected 'data' => 
    array (size=8)
      'version' => 
        array (size=6)
          'version' => string '8.1.2-1ubuntu2.19' (length=17)
          'opcache_product_name' => string 'Zend OPcache' (length=12)
          'php' => string '8.1.2-1ubuntu2.19' (length=17)
          'server' => string 'Apache' (length=6)
          'host' => string 'www' (length=3)
          'gui' => string '3.5.5' (length=5)
      'overview' => 
        array (size=22)
          'used_memory' => int 2145392144
          'free_memory' => int 4856
          'wasted_memory' => int 2086648
          'current_wasted_percentage' => float 0.097167119383812
          'num_cached_scripts' => int 55932
          'num_cached_keys' => int 73599
          'max_cached_keys' => int 262237
          'hits' => int 22263769
          'start_time' => int 1732575832
          'last_restart_time' => int 1732607469
          'oom_restarts' => int 0
          'hash_restarts' => int 0
          'manual_restarts' => int 7
          'misses' => int 57543
          'blacklist_misses' => int 0
          'blacklist_miss_ratio' => float 0
          'opcache_hit_rate' => float 99.742206013697
          'used_memory_percentage' => float 100
          'hit_rate_percentage' => float 100
          'used_key_percentage' => float 28
          'wasted_percentage' => float 0.1
          'readable' => 
            array (size=13)
              ...
      'files' => 
        array (size=55932)
          0 => 
            array (size=8)
              ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions