resource - Set resource consumption limits

- NAME
- SYNOPSIS
- FUNCTION DESCRIPTIONS

- AcquireMagickResource
- GetMagickResource
- LiberateMagickResource
- ListMagickResourceInfo
- SetMagickResourceLimit

# NAME

resource - Set resource consumption limits (e.g. memory)

# SYNOPSIS

MagickPassFail AcquireMagickResource( const ResourceType type, const magick_int64_t size );

magick_uint64_t GetMagickResource( const ResourceType type );

void LiberateMagickResource( const ResourceType type, const magick_int64_t size );

unsigned int ListMagickResourceInfo( FILE *file, ExceptionInfo *exception );

void SetMagickResourceLimit( const ResourceType type, const unsigned long limit );

# FUNCTION DESCRIPTIONS

## AcquireMagickResource

> AcquireMagickResource() acquires resources of the specified type. True is returned if the specified resource is available otherwise False.

> The format of the AcquireMagickResource() method is:

> MagickPassFail AcquireMagickResource ( const ResourceType type, const magick_int64_t size );

A description of each parameter follows:

type:

  The type of resource.

size:

  The number of bytes needed from for this resource.

## GetMagickResource

> GetMagickResource() returns the current consumption level for the specified resource type.

> The format of the GetMagickResource() method is:

> magick_uint64_t GetMagickResource ( const ResourceType type );

A description of each parameter follows:

type:

  The type of resource.

## LiberateMagickResource

> LiberateMagickResource() liberates resources of the specified type.

> The format of the LiberateMagickResource() method is:

> void LiberateMagickResource ( const ResourceType type, const magick_int64_t size );

A description of each parameter follows:

type:

  The type of resource.

size:

  The size of the resource.

## ListMagickResourceInfo

Method ListMagickResourceInfo lists the resource info to a file.

The format of the ListMagickResourceInfo method is:

> unsigned int ListMagickResourceInfo ( FILE *file, ExceptionInfo *exception );

A description of each parameter follows.

file:

  An pointer to a FILE.

exception:

  Return any errors or warnings in this structure.

## SetMagickResourceLimit

> SetMagickResourceLimit() sets the limit for a particular resource. The units for resource types are as follows:

      DiskResource    -- Gigabytes
      FileResource    -- Open files
      MapResource     -- Megabytes
      MemoryResource  -- Megabytes
      PixelsResource  -- Megapixels
    =for html <blockquote>The format of the SetMagickResourceLimit() method is: </blockquote>

> void SetMagickResourceLimit ( const ResourceType type, const unsigned long limit );

A description of each parameter follows:

type:

  The type of resource.

limit:

  The maximum limit for the resource.