Skip to content

Memory leak #2092

@momala454

Description

@momala454

This is:

- [x ] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

No memory leak

What is the current behavior?

Memory leak

What are the steps to reproduce?

The memory doesn't stop growing. My files are xls and xlsx, varies from 30kB to 21MB

<?php

require __DIR__ . '/vendor/autoload.php';

foreach (glob($this->filesFolder.'*') as $fileName) {
           echo number_format(memory_get_usage())."\n";
            $spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($fileName);
           $spreadsheet->disconnectWorksheets();
           $spreadsheet->garbageCollect();
           unset($spreadsheet);
        }

### Which versions of PhpSpreadsheet and PHP are affected?
1.17.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions