[ 
https://issues.apache.org/jira/browse/PROTON-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13998279#comment-13998279
 ] 

Andrew Stitcher commented on PROTON-558:
----------------------------------------

The current size (in bytes) of the FIELDS structure is
8448 *<pointer size> +
1421  (for the string data including terminating 0)

on a 64 bit machine that gives 69005 bytes (most of which will be 0). That is 
certainly a huge waste of space for an embedded machine. Although many (most?) 
of them will be 32 bit so the usage will be more like 35213 bytes (still bad 
enough)

By using the space more carefully we can get this down to around 3k:
* The actual string data (which after all is what we want here) is actually not 
too large
* There are actually only 118 different strings at present so we can index them 
with a single byte.

So we can change the FIELD table to only use table entry numbers that are a 
single byte, that saves 3 or 7 bytes per string.
Additionally we don't need to keep the indexes of all the strings for a 
particular index since we can arrange for the entries for that index to be 
sequential.

> Make friendly protocol field logging optional for low-memory devices
> --------------------------------------------------------------------
>
>                 Key: PROTON-558
>                 URL: https://issues.apache.org/jira/browse/PROTON-558
>             Project: Qpid Proton
>          Issue Type: Improvement
>          Components: proton-c
>    Affects Versions: 0.6, 0.7
>            Reporter: Markus Horstmann
>            Assignee: Andrew Stitcher
>
> Embedded devices tend to be memory constrained (i.e. 128KB RAM). The FIELDS 
> structure used for protocol logging consumes significant memory. Making it 
> optional would help reduce the memory footprint.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to