> From: Lombardo, Ed [mailto:ed.lomba...@netscout.com] > Sent: Friday, 3 May 2024 23.19 > > Hi Dmitry, > Thank you, I will give this a try.
Many arrays in DPDK are statically allocated at the build-time max array size, so tweaking DPDK's build-time configuration parameters will reduce the memory consumption. E.g. we tweak these (using DPDK 17.11): CONFIG_RTE_MAX_NUMA_NODES CONFIG_RTE_MAX_LCORE CONFIG_RTE_MAX_ETHPORTS CONFIG_RTE_MAX_QUEUES_PER_PORT > > Another angle is how can I calculate or determine when DPDK is > initialized how much total memory DPDK will use. Then I can provide > this to our application core and then they can take the DPDK memory max > requirement and subtract it from the total memory and this amount of > memory can be locked down by the app core. The application does not > want the locked down memory to be used by anything else. (just an idea > I thought of). I would love having this ability too. However, it depends on too many parameters, both build time and run-time, to be truly predictable. You have to run your application's DPDK initialization and configuration stages, and then measure it. That will help provide an estimate. You can check the memory consumption after calling rte_eal_init() and at different stages of application initialization, like this: struct rte_malloc_socket_stats stats, stats_sum; unsigned int socket; memset(&stats_sum, 0, sizeof(stats_sum)); /* Iterate through all initialized heaps */ for (socket=0; socket< RTE_MAX_NUMA_NODES; socket++) { if (rte_malloc_get_socket_stats(socket, &stats) < 0) continue; stats_sum.heap_totalsz_bytes += stats.heap_totalsz_bytes; stats_sum.heap_freesz_bytes += stats.heap_freesz_bytes; stats_sum.heap_allocsz_bytes += stats.heap_allocsz_bytes; } printf("DPDK hugemem used after rte_eal_init(): %.01f MB\n", (float)stats_sum.heap_allocsz_bytes / (float)(1024 * 1024)); > > Thanks, > Ed > > -----Original Message----- > From: Dmitry Kozlyuk <dmitry.kozl...@gmail.com> > Sent: Friday, May 3, 2024 4:57 PM > > 2024-05-03 23:54 (UTC+0300), Dmitry Kozlyuk: > > #define RTE_MAX_MEM_MB_PER_LIST 2024 // see item 4 below > > Typo: 2048