How can i get the amount of secodary memory occupied / available | developer.brewmp.com How can i get the amount of secodary memory occupied / available | developer.brewmp.com

Developer

How can i get the amount of secodary memory occupied / available

Forums:

Dear All:

i need to get amount the secondary memory available and occupied?
Unfortunately I didn’t find any API support in brew.
How can i get the amount of secondary memory occupied / available?
Can anybody help me out of this problem?

Thanx 4 ur concentration
Taj

I'm not sure what do you mean by term "secondary memory", however:
If you're looking for amount of available heap memory then you can use IHEAP_GetMemStats() to get amount of memory in use. Total amount of memory can be queried by using ISHELL_GetDeviceInfo().
If you're looking for available space in file system, then you should use IFILEMGR_GetFreeSpace(), which returns both total and available file system space.
IMPORTANT! This methods are not 100% accurate and you can't rely on them when you're allocating heap space or creating a file. You MUST provide fallback solution for every memory allocation and every file operation, since there is a high probability that they will fail to allocatespace in heap or file system, even if you pre-check using functions mentioned above.

I'm not sure what do you mean by term "secondary memory", however:
If you're looking for amount of available heap memory then you can use IHEAP_GetMemStats() to get amount of memory in use. Total amount of memory can be queried by using ISHELL_GetDeviceInfo().
If you're looking for available space in file system, then you should use IFILEMGR_GetFreeSpace(), which returns both total and available file system space.
IMPORTANT! This methods are not 100% accurate and you can't rely on them when you're allocating heap space or creating a file. You MUST provide fallback solution for every memory allocation and every file operation, since there is a high probability that they will fail to allocatespace in heap or file system, even if you pre-check using functions mentioned above.

There is no such thing as "secondary" memory, if you expect to see something like virtual memory or the like.

There is no such thing as "secondary" memory, if you expect to see something like virtual memory or the like.