Hi,
my plug in needs a lot of memory. Round about 100MB or a little bit more.
The reason for this is that there are a lot of calculation steps and I need to store the results in between for caching and faster processing.
How do I allocate such amount of memory?
Are there any tricks or hints?
I have the problem that I can oben the plugin 3-5 times and then photoshop crashes. (It crashes because the buffer suit allocation function cannot allocate more memory and my plugin do not handle this yet.)
Means photoshop cannot allocate more memory. It seems it doesn't free unused old memory even when I explicitely free it via buffer suit.
Any held welcome.
Regards Thomas
Allocating high amount of memory
ThomasTh@adobeforums.com wrote:
%26gt; I have the problem that I can oben the plugin 3-5 times and then photoshop crashes. (It crashes because the buffer suit allocation function cannot allocate more memory and my plugin do not handle this yet.)
%26gt; Means photoshop cannot allocate more memory. It seems it doesn't free unused old memory even when I explicitely free it via buffer suit.
It sounds more like a heap fragmentation problem. It may have 200meg free but
may not have a contiguous block of 100meg that you requested.
-X
--
for photoshop scripting solutions of all sorts
contact: xbytor@gmail.com
Allocating high amount of memory
%26gt;It sounds more like a heap fragmentation problem.
So what do you suggest?
Allocating small blocks?
My current code does the exact opposite. E.g. all U8-datas (think several layers of U8-data) are combined to one big U8-array to have only one allocation for it.
(U8 == unsigned char)
ThomasTh@adobeforums.com wrote:
%26gt;
%26gt; It sounds more like a heap fragmentation problem.
%26gt;
%26gt; So what do you suggest?
%26gt; Allocating small blocks?
If it really is a fragmentation problem, that would be the best solution.
%26gt; My current code does the exact opposite. E.g. all U8-datas (think several layers of U8-data) are combined to one big U8-array to have only one allocation for it.
%26gt;
I thought it might be something like this. It will add some complexity to your
code but it may be the only way to get the job done.
-X
--
for photoshop scripting solutions of all sorts
contact: xbytor@gmail.com
FYI:
I changed memory handling to more smaller pieces instead of large blocks of memory.
It seems to work now. But there is an interessiting side effect:
performance is significantly (axprox factor 2) improved...
Subscribe to:
Post Comments
(Atom)
No comments:
Post a Comment