How much storage do I have access to on WP7? - windows-phone-7

I know that storage is available via Isolated Storage, but I'm not sure I've seen anywhere how much actual storage I have access to for my app. Anyone know?

Your application isn't limited to a certain amount of disk space or any quota (like on "full" Silverlight). You can, in theory, keep adding files/using disk space until the device runs out.
You can test for available space with IsolatedStorageFile.AvailableFreeSpace.
You should be careful about using all available space as it will impact other apps and general device performance. Hopefully the OS will stop anything horrible happening if you did use all free space but best to try and avoid being the cause of this.
There are some limits on the number of fies and directories you can have but you're very unlikely to hit these. Details at http://dotnetcatch.wordpress.com/2010/09/08/wp7-how-many-files-does-it-take-to-crash-isolatedstorage-more-than-you-think/

MS says a minimum of 8GB but devices may have more installed
http://msdn.microsoft.com/en-us/library/ff637514(v=VS.92).aspx
There are no limits for a single app
[EDIT] There IS a limit for a single app:
2 Gigs is the total size your app can grow to.
http://www.imaginativeuniversal.com/blog/post/2010/10/04/20-50-90-400-and-2.aspx

Just wanted to add that OS will start screaming when only 10% memory is left.

Related

Windows Error Reporting IIS performance impact?

My question is simple. I just can't seem to find much information on it googling around. If I set up Windows Error Reporting to create memory dumps when an IIS app pool crashes (See article here for rundown.) could it cause any noticeable degradation in performance in terms of IIS serving up apps and websites?
We are looking to set this up in production to assist in tracking down issues when an app pool crashes. Also, is something like this recommended for production servers?
I assume you're using the LocalDumps Registry key to achieve this.
That Registry key has a setting called DumpType where you can specify the amount of data being collected.
The time it takes to capture the crash dump will mainly depend on the amount of data to be written to disk. A full memory crash dump of IIS can easily take 4 GB, which may take 8 seconds to be written to disk at a 500 MB/s disk throughput rate.
During those 8 seconds, another instance of IIS may still serve pages from cached files very fast, but might have trouble serving files that need to be read from disk.
You could mitigate this a bit by spending an extra disk or different partition for the crash dumps. You'll then just have the memory, CPU and SATA overhead.
Anyway, you'll not leave this setting on for very long. Just capture a few crash dumps and then disable it. You'll make your customers happier if you resolve the crash. Therefore, the performance impact IMHO is acceptable.
If you want to know the exact impact, you'd need to set up a load test system, serve pages and implement a website that crashes. You'll then notice (or not) the performance degradation and you'll be able to measure it.

Windows: track memory usage and limit threads

I am writing a Windows based application that uses the OpenCV library for image processing. This is a multi-threaded application and each thread loads an image and processes it. My problem is that when the images are huge, the memory consumption becomes very high and the application crashes.
I want to be able to track the amount of memory my app is using(from within the app) and dynamically restrict the number of threads being created. Is there a way in Windows to track how much of permitted memory the app is using( and how much more I will be allowed).
I am using VC++( VS2010 on Windows 7).
I did look at some questions such as this and this, but could not find any that allows tracking from within the app itself. Is this possible? Any guidelines would be helpful.
Don't know if this will have any serious impact on the memory consumption, but it's worth of checking if you haven't already done it.
When creating a thread, if you don't specify the stack size, the system will use the same amount as for the main thread. This could be 1MB. You probably don't need large stack, so try passing 32k, 64k, 128k...

Memory used by any iPhone app

There are a few things that I don't understand about iOS memory management.
I wanted to know how much memory typically an iPhone app takes while running on device (Is there any fix number like 10MB?)
If an app includes lot of large images what is the impact on the memory? Do they only impact memory when they are loaded?
How does iOS manage the memory when there are multiple apps running?
Please help me understand these concepts.
There isn't a stated or fixed amount of memory available to apps on iOS devices.
That said, there are game apps that are reported to use over 55MB of memory, however the OS is also reported to kill these games some significant percentage of the time if not run right after a device reset.
If you use 22MB of memory or less, the OS could still kill your app because there wasn't enough available memory, but it would also have to kill a massive percentage of other apps in the app store, so you would be in very good company.
When any app (foreground or background) requests enough memory to start depleting the memory pool sufficiently, memory warnings are sent to other apps. If the memory pool gets small enough, apps are killed, including possibly the foreground app if it's a big memory hog.
Q1) There isn't a fixed value, of course. Every application (and application instance) will use a different amount of memory depending on it's task(s). There is a maximum, however. Reaching this maximum will trigger a memory warning and the OS may kill it.
Q2) Images: Depends on how many you are showing at once, or through animations.
Q3) The application in the foreground gets the most memory allocated to it. Applications in the background can request memory to perform background tasks.
Good article for best practices:
http://inessential.com/2010/06/28/how_i_manage_memory

Finding Unmapped Network Share Capacity in Windows

I need to find the underlying disk capacity (total size) of an unmapped network share in windows (in Win7, Vista, XP, Server 2008), given a UNC path (e.g. given something like "\\share_1\subdir").
I've looked all over the web for several days and seem to find no answer to this issue. I would appreciate any leads. Thanks in advance for your time!
I would have given up by now, if it weren't for the ability to find the underlying free space of unmapped network shares, using the "GetDiskFreeSpaceEx()" Win32 function. I imagine that disk capacity is stored in a similar fashion to free space, hence retrieving it would be very similar (hence I'm somewhat infuriated with MS for not making the functionality obvious, or myself for not being able to find it thus far!)
Regards,
vivri
You are on the right track. GetDiskFreeSpaceEx will also display capacity, you just have to call the correct members.
See this Microsoft support link on how to do it.
Keep in mind that GetDiskFreeSpaceEx may only retrieve the free disk space by user. For instance, Windows Explorer uses GetDiskFreeSpaceEx also and it may not report the actual free physical disk space, but rather the user's logged in quota.

How do I limit RAM to test low memory situations?

I'm trying to reproduce a bug that seems to appear when a user is using up a bunch of RAM. What's the best way to either limit the available RAM the computer can use, or fill most of it up? I'd prefer to do this without physically removing memory and without running a bunch of arbitrary, memory-intensive programs (ie, Photoshop, Quake, etc).
Use a virtual machine and set resource limits on it to emulate the conditions that you want.
VMWare is one of the leaders in this area and they have a free vmware player that lets you do this.
I'm copying my answer from a similar question:
If you are testing a native/unmanaged/C++ application you can use AppVerifier and it's Low Resource Simulation setting which will use fault injection to simulate errors in memory allocations (among many other things). It's also really useful for finding a ton of other subtle problems that often lead to application crashes.
You can also use consume.exe, which is part of the Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 Service Pack 1 to easily use a lot of memory, disk space, cpu time, the page file, or kernel pool and see how your application handles the lack of available resources. (Does it crash? How is the performance affected? etc.)
Use either a job object or ulimit(1).
Create a virtual machine and set the ram to what you need.
The one I use is Virtual Box from SUN.
http://www.virtualbox.org/
It is easy to set up.
If you are developing in Java, you can set the memory limits for the JVM at startup.

Resources