Apple's mobile operating system - ios4

am new in iphone technology i just wanted to know what is the memory that ios4 occupies in the iphone, i have read that i phone 4 has 512MB of RAM and in wiki i read that ios uses 500MB of ram so am bit confused like if it uses 500MB of ram then it leaves only 12MB free memory space for third party app, please help me out regarding this.
Thank you

It's not something you need to worry about.
If you needed to know, the information would be available.
Write your application and, if it uses too much memory, then optimise it.
You will receive memory warnings if you start to approach the memory limit, which you can respond to appropriately.

It uses 500mb of swap space, which is space on the phone's actual storage, not RAM.

Related

Android studio emulator/AVD very high disk load (Linux)

I'm trying to use the android emulator coming with Android Studio (4.0) on Mint 18. Unfortunately as soon as I run a device, my disk sees heavy workload and I can't really tell why - it must be many small writes as I can see in nmon. This renders the whole emulation completely useless as the emulated device is not really responding any longer. It does not depend on which device I'm trying to emulate (Pixel/Pixel2/own HW).
What I can't see is, which files are affected and why. Even iotop only tells me that qemu-system-i386 is putting some workload on the disk but not where (of course).
The only thing I can tell is that all magic disappears if I start the device from commandline with the "-read-only"-Argument - then everything runs fine and fast.
But that's not a solution anyway because it doesn't preserve changes on the emulated device.
Any ideas?
I totally agree with Raman's comment: too much disk write. When I am using the android studio( "version": "dev build","buildNumber":"203.7717.56.2031.7678000",) emulator, the process with highest real time "disk write" value in gnome's system monitor, can reach 40 or 50 MB/s, which is quite astonishing. 40 or 50 MB/s not only in the start or end of emulation, it also happens as long as I make any operation in virtual device(i.e., swiping, clicking, opening apps). (BTW, ubuntu 20.04, ryzen 4800h, 16GB 3200 ddr4 dual channel RAM, emulating pixel 4, android 11 x86 with google play). I am also trying to find out why.
May be you could reduce the "disk write" by disable quickboot snapshot? I disabled automatic snapshot, and take a snapshot manually. Then disabled the quickboot, and set the default boot option from "quickboot" to "boot from one specific saved snapshot". Please remember, after setting the cconfiguration, you must reboot your PC to validate the settings, otherwise the settings may or may not take effect, or you simply could not open emulation unless reboot.
After rebooting, the "disk write" value drops down from 40 or 50 MB/s to a normal range, less than 1 MB/s in most of times. However, after rebooting, I could not read articles from official accounts in wechat app(from tencent company) in emulated android device. The articles are just stuck in loading status after clicking. So this setting may also affect some of normal functionalities.
https://developer.android.com/studio/run/emulator#snapshots
https://developer.android.com/studio/run/emulator#quickboot-troubleshooting
"Loading or saving a snapshot is a memory-intensive operation. If you do not have enough RAM free when a load or save operation begins, the operating system may swap the contents of RAM to the hard disk, which can greatly slow the operation. If you experience very slow snapshot loads or saves, you may be able to speed these operations by freeing RAM. Closing applications that are not essential for your work is a good way to free RAM."
For your description, "But that's not a solution anyway because it doesn't preserve changes on the emulated device." You could simply take a snapshot manually when you need to save, and set it as your boot snapshot.
I noticed it happened quite much for emulated devices with Google Play or Google Api images. Also, after waiting quite a while (let say 10 minutes), the phenomenon stops. What I do is to use, whenever possible, devices with low API levels, then with no Google Play image, and better, no Google Api at all. I also try to allocate quite a lot of ram to the emulated device (at least 3G). It is really astonishing how an emulated Android device with api level 15 is fast compared to a api level 30 or 31.

Debugging Memory Leak

I'm trying to figure out where my memory leak is coming from since lately i'm experiencing a lot of performance drop when just opening a new tab on my browser FireFox ver.51
Just to be sure I've disabled all non-Microsoft startup services in msconfig even after reboot it still gets stuck on this.
Looking up on the vendors updates for this machine then it would be up to date on the drivers, i do occasionally check for Intel Chipset and onboard Graphics drivers (stable versions only) myself that are a few years newer then the vendor.
MS Resource monitor
MS Taskmgr Perfomance monitor
In the Taskmgr Performance monitor you can see I'm barely using any CPU and I/O leaving out any form of I/O wait issues due to swapping.
When looking in the Resource monitor actual physical RAM in is about 6.3GB while Cached is only 1.6GB making it roughly 4GB RAM missing where it's usage is coming from.
So i did do a offline MemTest (oh yes the old blue gorgeous BIOS screen) and all checks were passed, luckily it's only 8GB RAM so the downtime is manage-able ;)
Any ideas or other handy tools I can use to find the culprit?
Already fixed it, seems like my pagefile is storing too much cached memory for some reason, will look into it myself why it stores so much memory

j2me wtk find memory leak

I built a game in j2me and I have memory leak because from time to time I get out of memory exception, now I want to spot where this leak is coming from and I heard you can do it with sun's wireless tool kit. Can someone explain me exactly what is this wireless tool kit, how I install it and how to use it in-order to find memory leaks ? Thanks in advance !
After you download wtk,Go to \bin\utilsw.exe.Under Utilities you will see "Memory monitor".Here you can graphically view app memory/RAM usage.
I do not know oracle sdk 3.4, but in wtk2 memory monitor was only partially useful for finding memory leaks, because it only shows how many (and which) objects are live, but not where they are referenced from. So it takes a review of corresponding piece of code.
Memory leaks are easier to find with a java profiler. You need to get one that suits you (I prefer YourKit, but it is commercial product with a trial period), modify emulator's command line in order to allow the profiler to connect (that should be covered by profiler's documentation, it is basically about adding -agentlib or -Xrun... option) to it, and do actual profiling (every profiler comes with a guide of how to do it).

Linux version of Windows "nonpaged pool" does such a thing exist?

I have been working with an Windows application which reads from the 'nonpaged pool' to increase performance. In this case the nonpaged pool is the area of memory where the network drivers write data as they grab it off the wire.
How does Linux handle memory which network drivers (or other drivers) which require high speed exclusive access to RAM and does the question 'how do I read directly from nonpaged pool?' even make sense when applied to Linux?
Many thanks
related question
Some networks like Infiniband support RDMA, which requires being able to prevent paging for some of the pages in a process. See the mlock(), mlockall(), munlock(), munlockall() functions.
Other than that, I don't think there is a concept of "nonpaged pool", per se. Generally, kernel memory is AFAIK not pageable, but all user memory except that locked with mlock() or such is.

Copy all current system data content in memory

I'm studying security, and I would like to know: in Windows or Unix based OS environment, is there a way for anything (programs or user with some knowledge) to copy all the content of the computer's memory?
My worry is about a hacker get my decrypted data loaded in memory. And how to avoid it.
The hacker may be the user himself.
On Windows you can generate a crash dump that will contain nearly all memory (if not all memory) if you configure the system to generate a "Complete memory dump":
http://support.microsoft.com/kb/254649
Then you just need to cause a bugcheck.
The nice thing about dealing with a crash dump file is that the Debugging Tools for Windows (and other tools) know how to parse a lot of information out of the files.
Generaly, if you are privileged user, you can access all memory you want.
if you have linux, you can login as root and dump kernel memory using
cat /proc/kcore.
A device driver or the OS itself could copy all memory. An suitably-privileged person could copy the portion of system memory that is paged or swapped into page files (on many operating systems, anyway). A privileged person could copy system memory dumps.
Is this what you're asking? If not, then you may want to give more detail. In particular, can you narrow down what kinds of operating system you're asking about? In school, you could be asking about really old ones, and the answers will be different.

Resources