Can you use the iPad's storage as virtual RAM?

Discussion in 'iPad Hacks' started by bdavis89, Nov 15, 2010.

  1. bdavis89 macrumors regular

    Joined:
    Sep 10, 2009
    #1
    I post this obviously in the jailbreak section because I'm pretty sure apple wouldn't allow it, but is there anything in the jailbreak realm that would let us use some of the iPad storage, since it's flash, as ram? I have a 16gb iPad, and would happily use 512mb+ to get better multitasking and speed. My inspiration is when you plug in a flash drive on windows you have the option of using it as RAM. I figured there might be a way to use unused space on the ipad for more RAM on the ipad? What do you guys think, is this possible?
     
  2. Intell macrumors P6

    Intell

    Joined:
    Jan 24, 2010
    Location:
    Inside
    #2
    It can be done, but it is damaging to the iPads flash storage.
     
  3. xraytech macrumors 68020

    Joined:
    Mar 24, 2010
    #3
    Yes but from what I read around the internets, on iOS 4.x it's not recommended.

    But if you are still interested here yah go.

    Using iFile, navigate to '/System/Library/LaunchDaemons/', then create a new file and name it 'com.apple.dynamic_pager.plist', set the 'owner' as 'root' and the 'group' as 'wheel', the rest leave them at default.

    - Copy the lines below, then go back into iFile and paste them as the content of the earlier created file. Now save the file and close iFile.

    Code:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>EnableTransactions</key>
    <true/>
    <key>HopefullyExitsLast</key>
    <true/>
    <key>Label</key>
    <string>com.apple.dynamic_pager</string>
    <key>OnDemand</key>
    <false/>
    <key>ProgramArguments</key>
    <array>
    <string>/sbin/dynamic_pager</string>
    </array>
    </dict>
    </plist>

    - Now still using iFile, navigate to "/Library/Preferences/" or "/private/var/preferences/" and create a file named "com.apple.virtualMemory.plist" with he same properties as the other one.

    - Copy and paste this into the new file, then save it:

    Code:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>UseEncryptedSwap</key>
    <false/>
    </dict>
    </plist>

    - Now reboot/restart your iPad, and you are good to go.

    To check if this is working right, open iFile back up, then navigate to '/private/var/vm/' and see if you have a file called swapfile0 that is 64MB in size.
     
  4. maturola macrumors 68040

    maturola

    Joined:
    Oct 29, 2007
    Location:
    Atlanta, GA
    #4
    YEs you can.

    Note: it is NOT recommended for several reason, first at all the OS was never build to support that type of functionality(unlike Windows, OSX, Linux, Unix or any Desktop/server OS that was coded to support that as in your example), so expect a VERY VERY Alpha type of behavior including hardware damage due to increasing the read/write cycles and reducing the life spam of some components.
     
  5. xraytech macrumors 68020

    Joined:
    Mar 24, 2010
    #5
    Agreed, use this hack at your own risk.

    That being said, I've been using the Virtual Memory hack since the "Spirit" Jailbreak and iOS 3.1.2 and have not had any issues with stability or wear & tear on the solid state memory of my iPad.
     
  6. Riemann Zeta macrumors 6502a

    Joined:
    Feb 12, 2008
    #6
    I don't think that burning out the Flash storage on the iPad is that much of a concern. First, the iPad is not really the type of device one will be using 5-10 years from now, when that would be a serious concern. And second, if virtual memory is so destructive to flash, wouldn't all modern operating systems be 'highly toxic' for SSDs?

    I assume it might screw with 3rd party apps and overall compatibility, though.
     
  7. xraytech macrumors 68020

    Joined:
    Mar 24, 2010
    #7
    Nope, works just fine. Actually my iPad has fewer hiccups with the Virtual Memory hack.
     
  8. Riemann Zeta macrumors 6502a

    Joined:
    Feb 12, 2008
    #8
    Cool. Now I guess I just need a good solid jailbreak solution for OS 4.2.
     
  9. xraytech macrumors 68020

    Joined:
    Mar 24, 2010
    #9
    From what I read from the original post of this hack, it will not work under iOS 4.2
     
  10. maturola macrumors 68040

    maturola

    Joined:
    Oct 29, 2007
    Location:
    Atlanta, GA
    #10
    SSD are a totally different issue all together, SSD got buffers and differente type of addressing and power scheme. that's how they work. Also the way the OS write to it is also different. believe me that type of hacks can damage flash easily. It is not going to kill the whole flash but sectors are going to star faling which it will cause the OS to freak out and execute error correction more often, exercising the flash even more.
     
  11. Riemann Zeta macrumors 6502a

    Joined:
    Feb 12, 2008
    #11
    I'm not entirely sure about that. I mean, yes, an SSD has a RAM buffer on the drive (usually anywhere from 32-128MB) for buffering writes, but it is not as if the OS swap partition/file will always reside in the write buffer. And I don't think that most operating systems address or treat SSDs differently (yet): the SSD's hardware controller--which itself is an entire SoC, with low-level "OS"--presents an SSD to a PC as if it were a normal spinning disk, with geometry and the whole works. The controller then handles translating "HDD-like" read and write commands from the OS into whatever bizarre, proprietary data addressing scheme that particular SSD uses. I remember reading that Windows 7 has a few special "SSD-aware" features, but Linux and Mac OS 10.6 don't really treat SSDs that much differently.

    Doesn't the flash RAM in an embedded device also have one of those controllers?

    However, I do see your point when it comes to the limited amount of RAM that the iPad has. In a conventional PC, with something like 4GB of RAM, there isn't going to be a whole lot of continuous swapping-out to disk going on; with the iPad and its 256MB, there will be.
     

Share This Page