Welcome to the iFans Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!

Virtual memory for iPad

Discussion in 'iPad' started by bahamutspirit, May 5, 2010.

  1. bahamutspirit

    bahamutspirit New Member

    Joined:
    May 3, 2010
    Messages:
    1,650
    Likes Received:
    0
    Device:
    iPad 2 (Black)
    Swap File for iPad to extend memory

    Edit: as of iOS 4.x, this is not necessary anymore, and can cause more crashes than it is worth, so I'm deleting the contents of this post.

    In case that's too much to read: DO NOT DO THIS ON iOS 4.x FIRMWARES!
  2. mitchell209

    mitchell209 Active Member

    Joined:
    Jan 21, 2009
    Messages:
    8,036
    Likes Received:
    5
    Device:
    iPhone 4 (Black)
    Wouldn't use virtual ram memory if i were you. :)
  3. J-Phone

    J-Phone Active Member

    Joined:
    Dec 1, 2009
    Messages:
    4,874
    Likes Received:
    14
    Device:
    iPhone 4 (Black)
    Just a question, why would we need more ram? the ipad has enough in my thought
  4. bahamutspirit

    bahamutspirit New Member

    Joined:
    May 3, 2010
    Messages:
    1,650
    Likes Received:
    0
    Device:
    iPad 2 (Black)
    It's actually called virtual memory, or swap file, not exactly RAM. RAM gets accessed a lot, page files are not...

    I know it's confusing, but if you read up on it, you'll see why it won't result in the storage media being accessed like crazy, contrary to belief.

    http://en.wikipedia.org/wiki/Paging

    If this feature would harm the system in any way, Apple wouldn't have left it in the kernel. Plus they seem to be using it in iPhone OS 4.

    Also just to elaborate further, the N900 also has a page file.

    As for why you need more RAM... Well, like I said, right now you can only have at most two tabs open in Safari at once. Any more and the old tabs get unloaded and you have to reload them. That's just too much of a hassle... and it makes having tabs redundant. Plus this technique (swapping files) is used by other browsers... say, Firefox on desktop does, Opera does, Google Chrome does, and I have no doubt Android also have it enabled or implemented in some way.

    Well, again, this is not virtual RAM. It's called virtual memory, or swap file, or page file... something entirely different.
  5. J-Phone

    J-Phone Active Member

    Joined:
    Dec 1, 2009
    Messages:
    4,874
    Likes Received:
    14
    Device:
    iPhone 4 (Black)
    i know all about virtual memory, im using it now. Use this will harm your device, it will shorten the devices life becuase it continuously writes and deletes on the Flash memory.
  6. ish1tsn0w

    ish1tsn0w Member

    Joined:
    Jan 8, 2010
    Messages:
    854
    Likes Received:
    3
    Device:
    2G iPod touch
    it will also drain your battery life.
  7. bahamutspirit

    bahamutspirit New Member

    Joined:
    May 3, 2010
    Messages:
    1,650
    Likes Received:
    0
    Device:
    iPad 2 (Black)
    No, it won't. The swap files are not accessed that often... due to performance issues.

    This does not use your storage as RAM. It uses your storage to store RAM data that is not used at the moment, but may be used later, sort of like caching. So your storage will not be written to and read from until RAM is full. That means... if you keep switching back and forth between two very intensive 3D games all the time, continuously, then it will be as you said, the storage will be written to and read from continuously. In that case, the device will die in 5 years of you continuously doing that... and that's assuming each Flash block can only take 1/10 of the current standard flash memory endurance. The real number is at around 50 years or so, which means you have to keep switching in and out of those two games for 50 years to make the storage blocks fail.

    And it won't drain your battery life. It happens only when it is needed, by default. This is what Apple left in the OS. They just felt that there would be no need to enable it since you only run one app at a time anyways. But you are better off enabling it for stability reasons.
  8. iPwn

    iPwn Community Development Staff Member

    Joined:
    Feb 5, 2010
    Messages:
    7,381
    Likes Received:
    526
    Device:
    Nexus 4
    YEah but NAND memory has limited read/write cycles. Using it as RAM, will kill your iPad.
  9. J-Phone

    J-Phone Active Member

    Joined:
    Dec 1, 2009
    Messages:
    4,874
    Likes Received:
    14
    Device:
    iPhone 4 (Black)
    basicly means your flash memory will die faster
  10. bahamutspirit

    bahamutspirit New Member

    Joined:
    May 3, 2010
    Messages:
    1,650
    Likes Received:
    0
    Device:
    iPad 2 (Black)
    Ahh, well, again, this, does, not, use, your, storage, as RAM.

    Say... when a process in the OS is idle, it still occupies a portion of the RAM, but it doesn't read or write or do anything to that portion. If a new process requests that space, then what this does is it backs up the portion to a file and store in on the storage, then offer the free RAM to the process demanding it.

    When the other process wants to access RAM back, the same thing occurs. The pager looks for a memory portion that is not used, backs it up, then gives it to the requesting process.

    The system WILL STILL CRASH if all running processes require access to a total of more than 256MB of RAM all at once. So there is no way for your storage to be used as RAM. It just stores unused RAM data for later.

    And this also applies to the iPhone and iPod Touch. The nand flash won't die when this is used.

Share This Page