librelist archives

« back to archive

Have any way to limit memory usage?

Have any way to limit memory usage?

From:
Johnny W. Santos
Date:
2013-03-04 @ 20:13
Hello guys, i'm using wand to convert a lot of PDF files into jpg, but the
memory used in each page get reach about 150 MB durint process. How can i
limit the memory usage for each image?

-- 
Johnny W. dos Santos
<https://www.facebook.com/johnny.welll>  <https://twitter.com/#!/OSrJota>
<http://br.linkedin.com/pub/johnny-santos/32/386/381>
<https://live.xbox.com/en-US/Profile?gamertag=johnny%20well>
<http://psnprofiles.com/Johnny_Jota>
http://codeseverywhere.com

Re: [wand] Have any way to limit memory usage?

From:
Hong Minhee
Date:
2013-03-04 @ 23:20
Hi,

The only way you currently can try out seems to be using 
SetMagickResourceLimit() C API using types.

  import ctypes
  from wand.api import libmagick

  libmagick.SetMagickResourceLimit.argtypes = [ctypes.c_int, ctypes.c_size_t]
  MemoryResource = 5
  libmagick.SetMagickResourceLimit(MemoryResource, 1024 * 1024 * 100)

I didn’t test the above code, so it might not work.  I will add a new API 
for this into Wand soon.


Thanks,
Hong Minhee

On Mar 5, 2013, at 5:13 AM, "Johnny W. Santos" <johnny.w.santos@gmail.com> wrote:

> Hello guys, i'm using wand to convert a lot of PDF files into jpg, but 
the memory used in each page get reach about 150 MB durint process. How 
can i limit the memory usage for each image?
> 
> -- 
> Johnny W. dos Santos
>     
> http://codeseverywhere.com

Re: [wand] Have any way to limit memory usage?

From:
Hong Minhee
Date:
2013-03-04 @ 23:35
I just added a new issue for this:

  https://github.com/dahlia/wand/issues/97

On Mar 5, 2013, at 8:20 AM, Hong Minhee <minhee@dahlia.kr> wrote:

> Hi,
> 
> The only way you currently can try out seems to be using 
SetMagickResourceLimit() C API using types.
> 
>  import ctypes
>  from wand.api import libmagick
> 
>  libmagick.SetMagickResourceLimit.argtypes = [ctypes.c_int, ctypes.c_size_t]
>  MemoryResource = 5
>  libmagick.SetMagickResourceLimit(MemoryResource, 1024 * 1024 * 100)
> 
> I didn’t test the above code, so it might not work.  I will add a new 
API for this into Wand soon.
> 
> 
> Thanks,
> Hong Minhee
> 
> On Mar 5, 2013, at 5:13 AM, "Johnny W. Santos" 
<johnny.w.santos@gmail.com> wrote:
> 
>> Hello guys, i'm using wand to convert a lot of PDF files into jpg, but 
the memory used in each page get reach about 150 MB durint process. How 
can i limit the memory usage for each image?
>> 
>> -- 
>> Johnny W. dos Santos
>> 
>> http://codeseverywhere.com
> 

Re: [wand] Have any way to limit memory usage?

From:
Johnny W. Santos
Date:
2013-03-04 @ 23:36
Thank's Hong Minhee, i'll try this tomorow morning and leave a feedback.


2013/3/4 Hong Minhee <minhee@dahlia.kr>

> Hi,
>
> The only way you currently can try out seems to be using
> SetMagickResourceLimit() C API using types.
>
>   import ctypes
>   from wand.api import libmagick
>
>   libmagick.SetMagickResourceLimit.argtypes = [ctypes.c_int,
> ctypes.c_size_t]
>   MemoryResource = 5
>   libmagick.SetMagickResourceLimit(MemoryResource, 1024 * 1024 * 100)
>
> I didn’t test the above code, so it might not work.  I will add a new API
> for this into Wand soon.
>
>
> Thanks,
> Hong Minhee
>
> On Mar 5, 2013, at 5:13 AM, "Johnny W. Santos" <johnny.w.santos@gmail.com>
> wrote:
>
> > Hello guys, i'm using wand to convert a lot of PDF files into jpg, but
> the memory used in each page get reach about 150 MB durint process. How can
> i limit the memory usage for each image?
> >
> > --
> > Johnny W. dos Santos
> >
> > http://codeseverywhere.com
>
>


-- 
Johnny W. dos Santos
<https://www.facebook.com/johnny.welll>  <https://twitter.com/#!/OSrJota>
<http://br.linkedin.com/pub/johnny-santos/32/386/381>
<https://live.xbox.com/en-US/Profile?gamertag=johnny%20well>
<http://psnprofiles.com/Johnny_Jota>
http://codeseverywhere.com

Re: [wand] Have any way to limit memory usage?

From:
Johnny W. Santos
Date:
2013-03-06 @ 13:23
Thank's for your support.

I tried do this in my code but nothing change, how i supposed to use this?


2013/3/4 Johnny W. Santos <johnny.w.santos@gmail.com>

> Thank's Hong Minhee, i'll try this tomorow morning and leave a feedback.
>
>
> 2013/3/4 Hong Minhee <minhee@dahlia.kr>
>
>> Hi,
>>
>> The only way you currently can try out seems to be using
>> SetMagickResourceLimit() C API using types.
>>
>>   import ctypes
>>   from wand.api import libmagick
>>
>>   libmagick.SetMagickResourceLimit.argtypes = [ctypes.c_int,
>> ctypes.c_size_t]
>>   MemoryResource = 5
>>   libmagick.SetMagickResourceLimit(MemoryResource, 1024 * 1024 * 100)
>>
>> I didn’t test the above code, so it might not work.  I will add a new API
>> for this into Wand soon.
>>
>>
>> Thanks,
>> Hong Minhee
>>
>> On Mar 5, 2013, at 5:13 AM, "Johnny W. Santos" <johnny.w.santos@gmail.com>
>> wrote:
>>
>> > Hello guys, i'm using wand to convert a lot of PDF files into jpg, but
>> the memory used in each page get reach about 150 MB durint process. How can
>> i limit the memory usage for each image?
>> >
>> > --
>> > Johnny W. dos Santos
>> >
>> > http://codeseverywhere.com
>>
>>
>
>
> --
> Johnny W. dos Santos
> <https://www.facebook.com/johnny.welll>  <https://twitter.com/#!/OSrJota>
> <http://br.linkedin.com/pub/johnny-santos/32/386/381>
> <https://live.xbox.com/en-US/Profile?gamertag=johnny%20well>
> <http://psnprofiles.com/Johnny_Jota>
> http://codeseverywhere.com
>



-- 
Johnny W. dos Santos
<https://www.facebook.com/johnny.welll>  <https://twitter.com/#!/OSrJota>
<http://br.linkedin.com/pub/johnny-santos/32/386/381>
<https://live.xbox.com/en-US/Profile?gamertag=johnny%20well>
<http://psnprofiles.com/Johnny_Jota>
http://codeseverywhere.com