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条)

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序