![]() |
||
Virtual memory for iPad |
||
|
What are you waiting for? Be member #461202!
Discuss the latest apps and accessories, or post your question on the forums! All visitors must register before they can post and answer questions and participate in our lively community, so register for free today! |
|
![]() |
|
|
Thread Tools | Search this Thread |
|
#1
|
||||||
|
||||||
|
Well, since it seems someone got away with leaking the RAM amount of iOS, I guess I can leak this much...
So... the truth is, iOS has always had the concept called... virtual memory. Meaning... virtual memory is always running. You can't avoid that. What is missing, actually, is something called Swap File, and this is the proper way to do it. Sorry, I intentionally screwed up the previous versions. You obviously need to have your iPad jailbroken, but along with that, you will need iFile. - 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> - 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> 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. The plist are in accordance to Apple's open-source codes, and the dynamic_pager plist was referenced from Mac OSX's version of the same plist, so you can guess that this is the absolute right way to do it. There shouldn't be any problem using it like this. Note that with this enabled, applications that you background will no longer be shut down automatically so you have to be really really really REALLY mindful of what it is you are backgrounding. Do NOT try to background a 3D game because the game is still running in the background the entire time, eating up GPU resources that would be valuable to other things such as... the interface. Better yet, don't background any game at all if you can live with that. At most background one music player and one web browser at a time, not more. If you do more, there is no guarantee the device will still work smoothly. You've been warned... Note: however, this will work fairly fine on iOS 4 as iOS doesn't actually background an entire app... so you don't have to be too mindful of what you are running.
__________________
Last edited by bahamutspirit; 4 Weeks Ago at 10:57 AM.. |
|
#2
|
|||||||
|
|||||||
|
Wouldn't use virtual
Last edited by mitchell209; 05-05-2010 at 04:20 PM.. |
|
#3
|
||||||
|
||||||
|
Just a question, why would we need more ram? the ipad has enough in my thought
|
|
Sponsored Links
|
|
|
|
#4
|
||||||
|
||||||
|
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. Last edited by bahamutspirit; 05-05-2010 at 04:17 PM.. |
|
#5
|
||||||
|
||||||
|
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
|
|||||||
|
|||||||
|
it will also drain your battery life.
|
|
#7
|
||||||
|
||||||
|
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. Last edited by bahamutspirit; 05-05-2010 at 04:24 PM.. |
|
#8
|
|||||||
|
|||||||
|
YEah but NAND memory has limited read/write cycles. Using it as RAM, will kill your iPad.
|
|
#9
|
||||||
|
||||||
|
basicly means your flash memory will die faster
|
|
#10
|
||||||
|
||||||
|
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. |
![]() |
| Thread Tools | Search this Thread |
|
|