RagHaven
RagHaven

Reputation: 4347

Does Malloc get memory from RAM or cache

I have a Native android app which Makes a lot of calls to Malloc. I am trying to allocate a chunk of the RAM and then run some memory intensive tasks to see how my Android device handles it. But I am not sure if the device is taking memory from the RAM or other sources of memory. Is there a way to find out? If it is taking memory from the cache, how do I make it so I am allocating the memory only from the RAM?

Upvotes: 0

Views: 836

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007276

But I am not sure if the device is taking memory from the RAM or other sources of memory

malloc() allocates memory from the process' heap, which in turn comes from the device RAM. It has done so for decades.

Upvotes: 2

Related Questions