<?xml version="1.0" encoding="UTF-8"?>
<!-- this file is autogenerated, do not edit! -->
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
	"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<chapter id="rpc_exports.malloc_test">
	<title>
RPC Exports for malloc_test
	</title>


<section id="mt.mem_alloc"><title>mt.mem_alloc</title>
<para>
        Allocates the specified number of bytes (debugging/test
        function). Use b|k|m|g to specify the desired size unit
</para>
<para>
</para>
</section>

<section id="mt.mem_free"><title>mt.mem_free</title>
<para>
        Frees the specified number of bytes, previously allocated by
        one of the other malloc_test functions (e.g. mt.mem_alloc or
        the script mt_mem_alloc). Use b|k|m|g to specify the desired
        size unit. Returns the number of bytes freed (can be higher or
        smaller than the requested size)
</para>
<para>
</para>
</section>

<section id="mt.mem_realloc"><title>mt.mem_realloc</title>
<para>
        Reallocates the specified number of bytes from a pre-allocated
        randomly selected memory chunk. If no pre-allocated memory
        chunks exists, it will fail. Make sure mt.mem_used is non 0 or
        call mt.mem_alloc prior to calling this function. Returns the
        difference in bytes (&lt;0 if bytes were freed, &gt;0 if more
        bytes were allocated). Use b|k|m|g to specify the desired size
        unit
</para>
<para>
</para>
</section>

<section id="mt.mem_used"><title>mt.mem_used</title>
<para>
        Returns how many memory chunks and how many bytes are currently
        allocated via the mem_alloc module functions. Use b|k|m|g to
        specify the desired size unit.
</para>
<para>
</para>
</section>

<section id="mt.mem_rnd_alloc"><title>mt.mem_rnd_alloc</title>
<para>
        Takes 4 parameters: min, max, total_size and an optional unit
        (b|k|m|g). It will allocate total_size memory, in pieces of
        random size between min .. max (inclusive).
</para>
<para>
</para>
</section>

<section id="mt.mem_test_start"><title>mt.mem_test_start</title>
<para>
        Takes 7 parameters: min, max, total_size, min_interval,
        max_interval, test_time and an optional size unit (b|k|m|g).
        All the time units are ms. It will run a memory allocation test
        for test_time ms. At a random interval between min_interval and
        max_interval ms. it will allocate a memory chunk with random
        size, between min and max. Each time total_size is reached, it
        will free all the memory allocated and start again. Returns the
        test id (integer)
</para>
<para>
</para>
</section>

<section id="mt.mem_test_stop"><title>mt.mem_test_stop</title>
<para>
        Takes 1 parameter: the test id. It will stop the corresponding
        test. Note: the test is stopped, but not destroyed.
</para>
<para>
</para>
</section>

<section id="mt.mem_test_destroy"><title>mt.mem_test_destroy</title>
<para>
        Takes 1 parameter: the test id. It will destroy the
        corresponding test.
</para>
<para>
</para>
</section>

<section id="mt.mem_test_destroy_all"><title>mt.mem_test_destroy_all</title>
<para>
        It will destroy all the tests (running or stopped).
</para>
<para>
</para>
</section>

<section id="mt.mem_test_list"><title>mt.mem_test_list</title>
<para>
        If a test id parameter is provided it will list the
        corresponding test, else it will list all of them. Use b |k | m
        | g as a second parameter for the size units (default bytes)
</para>
<para>
</para>
</section>

</chapter>
