[cfe-dev] Address sanitizer memory usage
Kostya Serebryany via cfe-dev
cfe-dev at lists.llvm.org
Fri Dec 8 10:12:44 PST 2017
+ Devin and Kuba from Apple, who may have iOS-specific knowledge.
We've recently made several changes that make asan consume less memory, but
* these changes are not yet in Xcode 9 (I assume)
* I am not 100% sure these changes affect iOS (we tested only on Linux,
Kuba has recently applied related patches for Mac)
* Your problem might be caused by something else
Typically the biggest source of memory consumption is quarantine and the
stack trace storage (stack_depot).
If you are able to set ASAN_OPTIONS env var, please try this:
ASAN_OPTIONS=quarantine_size_mb=1:malloc_context_size=5
quarantine_size_mb=1 limits the quarantine size (and thus reduces the
ability to find use-after-free)
malloc_context_size=5 reduces the length of stack traces that asan stores
for future bug reporting
If these don't help, we'll need more details (e.g. the iOS's analog of
/proc/PID/maps for the process at the time of failure)
--kcc
On Thu, Dec 7, 2017 at 12:56 PM, Michael Eisel via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> Hi,
>
> I'm working on an iPhone app that rarely runs out of memory normally, but
> with the address sanitizer on will crash after a couple minutes. I don't
> remember it crashing this much with Xcode 8's version of clang, but in any
> case I'm using Xcode 9 now. Although crashing after a couple minutes is
> fine for testing during development, I would like to distribute the app to
> internal testers with asan built into it, and I don't want to impact their
> experience so much. Is there any simple way to reduce memory use, e.g. by
> turning off some component of asan?
>
> Thanks,
> Michael
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20171208/160d880b/attachment.html>
More information about the cfe-dev
mailing list