gpt4 book ai didi

memory - ImageMagick 使用超过 2GB 的内存来转换 PDF 文件

转载 作者:IT王子 更新时间:2023-10-28 23:33:09 28 4
gpt4 key购买 nike

ImageMagick 使用大量内存来转换 PDF 文件 - 超过 2GB。我正在使用的命令是:

convert -density 250 -resize 1280x myfile.pdf -interlace plane -strip -quality 40 -alpha flatten myfolder/myfile-%03d.jpg

如何改进?我有 1GB 的限制,否则进程会被无情地杀死。 ):

最佳答案

使用内存限制选项。

此处显示的选项用法:

http://www.imagemagick.org/script/command-line-options.php#limit

-limit type value

Set the pixel cache resource limit.

Choose from: area, disk, file, map, memory, threads, or time.

The value for file is in number of files. The other limits are in bytes. Define arguments for the memory, map, area, and disk resource limits with SI prefixes (.e.g 100MB).

By default the limits are 768 files, 3GB of image area, 1.5GiB memory, 3GiB memory map, and 18.45EB of disk. These limits are adjusted relative to the available resources on your computer if this information is available. When any limit is reached, ImageMagick fails in some fashion but attempts to take compensating actions, if possible. For example, the following limits memory:

-limit memory 32MiB -limit map 64MiB

关于memory - ImageMagick 使用超过 2GB 的内存来转换 PDF 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15384879/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com