0

how do i increase the available memory (more concrete: the part of the RAM) that can be used by my app? i am not referring to the space available on the harddisk of an iphone, but to the RAM.

does anyone know if there's a way to use the whole free part of the RAM for my app only?

i have to clear this up a bit, sorry if it was too vague:

i had to think of the java heap size, which can be increased by adding a parameter to the startup command of the java programming. as i don't know, but at the moment suppose on the iphone something similar happens (every app has just xxMB RAM for execution) this value might be adjustable, so that i can use the whole remaining RAM for my app. which pretty much is what i need for this special app (non-app-store-publication; file-sizes between 50MB and several 100MB)

trincot
  • 317,000
  • 35
  • 244
  • 286
m Jae
  • 725
  • 2
  • 8
  • 20

5 Answers5

5

How do i increase the available memory?

Short answer: you don't.

Memory is managed by the kernel.
Your application process can't control this.

Macmade
  • 52,708
  • 13
  • 106
  • 123
  • 1
    Just to add to this, iOS will close other programs to reclaim more RAM if/when needed. So if you want to keep your app alive, keep a small footprint and handle backgrounding well. Good answer. – Bill Burgess Jan 25 '12 at 20:54
1

You can't explicitly control this - this is managed by iOS.

barfoon
  • 27,481
  • 26
  • 92
  • 138
1

You can't do that. Try reducing your memory usage instead of looking for ways to remove well needed limits.

Store your data instead and read from it when needed.

Zar
  • 6,786
  • 8
  • 54
  • 76
  • "Store your data instead and read from it when needed." - that's exactly what i am doing when receiving memory warnings... – m Jae Jan 25 '12 at 21:07
0

I don't know for sure if you can configure RAM allocated for your app. I think that is taken care of by the iOS kernel

Quasar
  • 137
  • 3
0

It's unlikely (read: not going to work) that you will be able to allocate anything more than a few Mb in your application at once.

Not planning on publishing your app to the App Store won't change this. Apple don't officially acknowledge the amount of memory in iOS devices. But its known that devices have between 128Mb and 512Mb of physical RAM.

With the kernel, essential applications (Phone app, etc), background processes, etc, you won't have anything like that available to your application. Careful analysis in instruments would suggest that you'll generally start getting memory warnings when you've allocated around 22Mb of RAM in your application.

A change made in iOS 5 makes the watchdog process much more aggressive with killing applications after you get a memory warning. If you get a memory warning on iOS5 you have to reduce your memory usage or you will get jettisoned by the OS.

If you want to proceed, you will have to figure out how to reduce the amount of memory your datasets require. Its unlikely that all of the 100Mb file needs to be in memory at once. iOS devices have "relatively" fast CPU's and storage, you'll have to architect your application to read and write to storage in chunks and work on smaller subsets of your data.

Some related Stackoverflow questions and links:

Community
  • 1
  • 1
Damien
  • 2,421
  • 22
  • 38