Iterate Key Value Array Python Memory Allocation In Java