I want to reduce memory usage, in the save method of the psd, it is where it consumes a lot of memory. How can I limit memory usage to a certain number? I have tried the following:
Cache.CacheType = CacheType.CacheInMemoryOnly;
Cache.MaxMemoryForCache = 1073741824;// 1 gigabyte
long l1 = Cache.AllocatedDiskBytesCount;
long l2 = Cache.AllocatedMemoryBytesCount;
//load psd file
PsdImage image = (PsdImage)Image.Load("C:\\psd_example.psd");
if (!image.IsCached)
{
image.CacheData();
}
image.Save("C:\\psd_output");
long diskBytes = Cache.AllocatedDiskBytesCount;
long memoryBytes = Cache.AllocatedMemoryBytesCount;
l1 = Cache.AllocatedDiskBytesCount;
l2 = Cache.AllocatedMemoryBytesCount;
@cristianortegaethofy
Thank for the idea. We have some plans on 2024 on RAM usage optimization. But at this moment Aspose.PSD uses maximum available memory if this is not enough than it starts partial processing. But for the case with big files, any available RAM will be not enough, so this feature can be useful.
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PSDNET-1826
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
@cristianortegaethofy This task is planned for 2024. There are no news at the moment. If one of the developers becomes available, we will try to do it faster.