Re: ubc and removable devices
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=eWzinMXrE+8TLXtivLSGixmtKRa4mSQ7jnvo5DYV0GU=; b=vLh1LcieWYeVnWz27mg7bVMQGhSHt+gYtW+gIpTlL5h4jXjHb6feqS+KdaU3UUtuAE +BoeYww3QKa6R26bleWWm67iqjVslVKX9oLPV8MbuTTv4cDA3n9DRi7W11jtA7rto3HR s6HXy3Na9mFO30KjH7oL5LpA8DSSeMpRYl+DY= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=mmg6WTjwBmq30uM/nAlMTCGOVgUE/MorpU/FzhrAkOi7dMjdOj5AYxIBdK4W8EYJtl ciDNYVjVhiKuwH6u+Gif8PDiAis8q9d3yC6qjprFYL1c615EJP0ZgJThcfd7mxy+Q0Jn odEqwAGwH5GhGyL3FRrKHVl9pifolCTsSYRdg= On Nov 10, 2009, at 7:53 AM, Stefan Haller wrote: Yes but it doesn't evict mmap-ed dynamic libraries. You need to allocate 2x physical memory for it to happen. I have 4Gb of physical memory so allocating twice that and then touching every page (below) takes over 4 minutes. It's much faster to place the app on a removable device and then eject the device to purge the caches of the app data. I haven't looked for this behavior in the kernel source code but it seems to be consistent and logical when I think about it. Another alternative is rebooting but that takes about a minute and requires me to restore all the apps I have running. --- #!/usr/bin/env python import mmap SIZE = 8589934592L # 8Gb map = mmap.mmap(-1, SIZE) map[::4096] = '\x01' * (SIZE // 4096) --- #include <sys/mman.h> #include <fcntl.h> #include <stdio.h> static long SIZE = 8589934592L; for (i = 0; i < SIZE; i += 4096) result[i] = 1; return 0; } return 1; } --- firefox for android! http://wagerlabs.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Did you try the "purge" command-line tool? int main(int argc, char**argv) { char *result = mmap(0, SIZE, PROT_READ|PROT_WRITE, MAP_ANON| MAP_PRIVATE, -1, 0); if (result != MAP_FAILED) { unsigned long i; This email sent to site_archiver@lists.apple.com
participants (1)
-
Joel Reymont