fix memory counting without custom allocator (#8102)
### Description
<!--
✍️ Write a short summary of your work.
If necessary, include relevant screenshots.
-->
### Testing Instructions
<!--
Give a quick description of steps to test your changes.
-->
Closes PACK-3044