1 (edited by johankleuskens 2014-12-09 09:02:11)

Topic: [SOLVED] Max amount of memory needed for XMALLOC/XREALLOC

I'm implementing wolfSSL for Octeon, and i need to implement my own malloc() and realloc() function via XMALLOC and XREALLOC. Because a fixed size memory is used for this, i need to know what the maximum amount of allocated memory will we in wolfSSL. Experiments show that untill now the maximum does not exceed 2048 bytes, but it would be nice if you could specify what the maximum amount will be.

Share

Re: [SOLVED] Max amount of memory needed for XMALLOC/XREALLOC

Hi,

Can you clarify if you are looking for the total heap usage?  Or the heap usage for a single connection?  In either case, I think our Resource Use document will be helpful.  It should be attached to this post.

It sounds like you already found our memory abstraction layer (XMALLOC, XREALLOC, etc.).  There are a few more details on this in Section 5.1.1.1 of the CyaSSL Manual:

http://yassl.com/yaSSL/Docs-cyassl-manu … ility.html

Best Regards,
Chris

Post's attachments

CyaSSLResourceUse.pdf 206.96 kb, 3 downloads since 2014-12-11 

You don't have the permssions to download the attachments of this post.

Re: [SOLVED] Max amount of memory needed for XMALLOC/XREALLOC

Hi Chris,

When using XMALLOC, the application specifies the size of the memory that must be allocated. So XMALLOC(100,0,0) will allocate a contiguous memory of 100 bytes. It is the maximum value of this size that i am interrested in. So what is the maximum nr of bytes that is allocated via XMALLOC in wolfSSL in one call of XMALLOC.

The reason for my question is this. I have ported wolfSSL to OCTEON. The OCTEON processor can allocate dynamic memory very fast, but is will allocate only a predefined and static amount of memory. So this predefined amount of memory has to be large enough to host te largest amount of memory that will be allocated via wolfSSL. if i now what the largest amount of allocated memory in wolfSSL will be, i can determine the amount of memory that has to be allocated by the OCTEON when executing an allocation of memory.

Hope this does clear up things.


Regards,

Johan Kleuskens

Share

Re: [SOLVED] Max amount of memory needed for XMALLOC/XREALLOC

Hi Johan,

The maximum amount of memory allocated by a SINGLE call to XMALLOC() will be a little over 17kB (17kB + 102 bytes).

Best Regards,
Chris

Re: [SOLVED] Max amount of memory needed for XMALLOC/XREALLOC

Thanks Chris!

Share

6 (edited by johankleuskens 2015-02-15 03:53:20)

Re: [SOLVED] Max amount of memory needed for XMALLOC/XREALLOC

Just for completeness: tests show that the max amount of memory allocated in wolfSSL in a singel call via XMALLOC is 17518 bytes (which is 17kB + 110 bytes).

Share