• Resolved Anonymous User 17880307

    (@anonymized-17880307)


    In scan.php line 3.7.3 causes memory exhaustion:

    file_put_contents( NSCAN_TMP_SNAPSHOT, serialize( $snapshot ) );

    I think serialize is still problematic.
    Also not the whole snapshot should be saved at once. It should be one line per entry and maybe json_encode. See also my previous threads regarding possible improvements.

    The error happened after the NinjaScanner and NinjaFirewall plugins were installed (and a file manager) so it was caused by too many new files / changes. It also happens when the relevant scan folder is deleted in wp-content/ninjascanner.

    The actual error messages:

    Allowed memory size of 134217728 bytes exhausted (tried to allocate 1744455 bytes)

    05-Feb-22 22:13:22 ERROR Error: E_ERROR (Allowed memory size of 134217728 bytes exhausted (tried to allocate 1744455 bytes) - line 373 in /www/htdocs/wp-content/plugins/ninjascanner/lib/scan.php)

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Anonymous User 17880307

    (@anonymized-17880307)

    And another one:

    05-Feb-22 22:29:10 INFO  Comparing previous and current file snapshots
    05-Feb-22 22:29:10 ERROR Error: E_ERROR (Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) - line 1760 in /www/htdocs/wp-content/plugins/ninjascanner/lib/scan.php)
    05-Feb-22 22:29:12 INFO  Cancelling scanning process (nscan_check_status: response != success)
    • This reply was modified 3 years, 4 months ago by Anonymous User 17880307.
    Plugin Author nintechnet

    (@nintechnet)

    A flat file in CSV format would solve those issues. I use that format for the Code Profiler plugin. It can deal with hundreds of MB of data without any memory issue.
    But that would be for the next major version of NinjaScanner, because there will be a lot of code to rewrite.

    Thread Starter Anonymous User 17880307

    (@anonymized-17880307)

    Thanks, this approach sounds like an ideal solution.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘memory exhausted (scan.php)’ is closed to new replies.