nDPI icon indicating copy to clipboard operation
nDPI copied to clipboard

It's time to make `struct ndpi_flow_struct` small again

Open IvanNardi opened this issue 1 year ago • 3 comments

On Jan 30, 2022 (see https://github.com/ntop/nDPI/commit/5bb5bec477e1a10a404fd9228ddc0f5041b51123)

nDPI Memory statistics:
	Flow Memory (per flow):  688 B 

Now

nDPI Memory statistics:
	Flow Memory (per flow):  1.16 KB 

IvanNardi avatar Nov 26 '24 18:11 IvanNardi

Is it possible to move protocol-specific stuff out of struct ndpi_flow_struct into something else and leave something like void* protocol_data pointing to a protocol-specific stuff? Well, I dunno, probably it's not the best solution.

0xA50C1A1 avatar Dec 02 '24 14:12 0xA50C1A1

IMHO most of the L7 protocol stuff is already a union.

utoni avatar Dec 02 '24 14:12 utoni

It could be worth checking if the struct members especially arrays could be reduced or removed i.e. host_server_name requires 80 bytes per flow, but from my experience, I think that that the array size is a waste of memory most of the times.

utoni avatar Dec 03 '24 03:12 utoni