Is it possible to getting total/available memory on Windows Phone? - windows-phone-7

How to getting total/available memory on Windows Phone? The total/available memory what I mean is for the whole device, not only for my application itself, can I get them?

You can get the device's total memory (potentially useful for detecting low memory devices) by using the DeviceExtendedProperties class on 7.0 or the DeviceStatus class on 7.1.
You can also access the amount of memory your app is currently using and the most it has used, but there is no way to find the available memory for the device.

Your application can only access the memory of its isolated storage and cannot interrupt with other applications. This is a constraint but have to cope with it.

Related

How to split RAM for each Windows OS and my application?

I want to split RAM in my PC into two parts; half for my Windows OS and the other half for an image buffer for my application. For example, my desktop has 32GB memory, and I want to assign 16GB for Windows and assign another 16GB for my application access only. Windows doesn't touch the other 16GB but my application should use that 16GB image buffer. I know how to do this in Linux, but I need to do this in Windows OS. I think I have to configure the BIOS and need to implement a page remap Windows driver of image buffer for my application access.
Is there any good way to do this?
You can do this with the Address Windowing Extensions API. Although this was originally designed for 32-bit applications, it is still available to 64-bit applications, and memory allocated this way is not available to the virtual memory management system.
However, you should note that in most cases allowing the virtual memory manager to do its job will result in better overall performance than explicitly locking down memory will.

Detect Approaching App Mem Limit on Windows Phone

I am wondering if there is a way for a Universal Windows Phone app (Windows Phone 8.1 or 10) to detect if the app is using much memory and is approaching the memory limit that apps have on a Windows Phone (before it gets killed by the OS)?
Ideally the OS/platform would provide API/services for an app to register and listen to an event that is raised, telling the app that it has consumed almost all of the memory that it is allowed to have so that the app can take appropriate actions (force release some cached data) to clear up some memory and avoid being killed by the OS. But I'm not sure if such API exists on Windows Phone 8.1 or 10 for a Universal Windows App!?
The Windows.System.MemoryManager methods report on the app's memory usage and memory limit and raises events as the limit changes and as usage increases and decreases between low, medium, and high levels.

Read physical memory under Windows 8

I would like to be able to plug in a physical address, and read the data stored at that address.
Under Linux, I would use /dev/mem to acquire this data. Under Windows 8, I'm not sure what mechanism is available to do this.
My use case is inspecting a PCI Express device. The PCI Express device creates a ring buffer at a known address, that I can determine from the PCIe BAR. Once this address has been set, it won't change until the computer restarts.
Currently, I can use applications like RW Everything to see the data there, but I would like to be able to do this without user interaction (Without the GUI) so that I have fewer issues with the ring buffers wrapping before I can access the data.
Does anyone know if there is a privileged Windows system call I can make from userspace (to mmap a region for example) or do I need to use a custom kernel module to do this? I imagine that there is some way to do it without a custom kernel module, because I don't believe I installed one when I installed RW Everything.
Since Windows Server 2003 SP1, user-mode access to physical memory has not been possible. You will have to develop a driver to do it (or find a third-party tool that includes one).
From Technet:
In Windows Server 2003 SP1, user-mode access to the \Device\PhysicalMemory object is not permitted. All forms of access (read, write) are refused when the \Device\PhysicalMemory object is accessed from a user-mode application. Access to the \Device\PhysicalMemory object is refused regardless of the user context (Administrators, Users, Local System, etc.) the application is running in.
There are many windows software to access the physical memory, however, many of them cannot access the physical memory in windows vista or 7 because of physical memory protection feature in these OS's.
There are many windows tools similar to dev/mem unix's one, such as:
Belkasoft Live RAM Caputer
WindowsSCOPE Pro and Ultimate, available at http://www.windowsscope.com
WindowsSCOPE Live
winen.exe (Guidance Software - included with Encase 6.11 and higher)
Mdd (Memory DD) (ManTech)
MANDIANT Memoryze
Kntdd
Moonsols
HBGary
FTK Imager
OSForensics
WinPmem; and
Windows Memory Reader
Check this wiki for more info:
http://www.forensicswiki.org/wiki/Tools:Memory_Imaging

What is the appropriate number of memory usage for Windows Phone app

as my title.
I heard that my friend's app was failed to publish to marketplace. Because it consumes more than 90MB phone memory.
I'm developing an application and it uses about 30-60 MB (according to memory counter display from this link.)
Firstly I thought it was too much for a mobile app. I put all my data entries into memory in order to do search, instead of querying them from SQLite which is too slow for me.
So what do you think about the appropriate number of the phone memory for a regular mobile application.
Well, Microsoft Certification Requirements document says that:
An application must not exceed 90 MB of RAM usage, except on devices that have more than 256 MB of memory.
If you break this rule, your application won't pass Microsoft certification process.

Increase memory for shared memory

When trying to get shared memory, shmget() often fails because being unable to allocate memory. The physical size of RAM really shouldn't be the problem (4GB is enough, I think).
Rather there's probably anywhere in the systems properties a limit for allocating shared memory set. Does anyone know, where I can find this property?
I'm using Mac OS X Version 10.6
Depends on the OS. PostgreSQL documentation has tips for changing the shared memory limit on various platforms.

Resources