php-ext-xlswriter icon indicating copy to clipboard operation
php-ext-xlswriter copied to clipboard

fix: 内存模式下,设置单个单元格内容格式,内存模式会失效,导致内存不断堆叠溢出

Open mingdiantianxia opened this issue 3 years ago • 3 comments

$config     = ['path' => '/'];
$excel = new \Vtiful\Kernel\Excel($config); 
$fileObject = $excel->constMemory('test.xlsx', '内存占用', false);
for ($index = 0; $index < 10000; $index++) {
    for ($column = 0; $column < 300; $column++) {
        $mem = self::getMemoryUsage('MemRealUsage');
        $mem = $mem / (1024 * 1024);
        $fileObject->insertText($index+1, $column, floatval($mem), 'Max$#,##0.00;Max$-#,##0.00');
        var_dump($mem);
    }
}
$filePath = $fileObject->output();
$fileObject->close();

mingdiantianxia avatar Sep 29 '22 04:09 mingdiantianxia

Hello, have you resolved this issue?

c-c-j avatar Jun 25 '24 12:06 c-c-j

@viest

c-c-j avatar Jun 25 '24 12:06 c-c-j

image The extended and dependent versions I am using are as follows. I actively called the close method to destroy resources, but the server content remains consistent and is being added @viest

c-c-j avatar Jun 25 '24 13:06 c-c-j