duannuo4620 2013-05-01 08:58
浏览 362
已采纳

消耗内存的TCPDF并没有释放内存

I am using TCPDF library to generate report on one of my application. When ever i generate PDF using TCPDF, chunk of memory get allocated like 256MB & after generating the PDF, that allocated memory is not getting free.

This is blocking around 2GB memory. So the final solution which i have is change the TCPDF lib with other lib.

Can anybody knows why TCPDF allocates the memory or is there any way to flush the memory after the pdf generation?

  • 写回答

2条回答 默认 最新

  • duanqianmou4661 2013-05-01 10:05
    关注

    Are you cleaning your output buffer in your View? I am also using TCPDF in some of my Cake projects, but never had this problem. Your view should have somthing like this:

    <?php
    // Start output buffering
    ob_start();
    
    // Your TCPDF code here
    
    // Clean the output buffer
    ob_end_clean();
    

    Works just fine for me, memory is freed right after generation.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程