• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: malloc errors / fragmentation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: malloc errors / fragmentation?


  • Subject: Re: malloc errors / fragmentation?
  • From: Eric Gouriou <email@hidden>
  • Date: Fri, 31 Oct 2008 02:36:35 -0700


On Oct 30, 2008, at 3:41 PM, Jay Levitt wrote:
Back in May, Sean McBride wrote:

Sometimes I see messages like:


malloc: *** mmap(size=16883712) failed (error code=12) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug
and Eric Gouriou replied:
I'd give vmmap a try and look for a VM fragmentation issue.
I'm seeing the same thing on my 16GB Mac Pro (early 2008, OS X 10.5.5). I'm getting crashes every few days in WindowServer or coreservicesd; MenuMeters and Activity Monitor say I've got plenty of available RAM (either unused or idle). system.log says:

system.log.0.bz2:Oct 29 14:35:19 macpro com.apple.coreservicesd[89]: coreservicesd(89,0xa0220fa0) malloc: *** mmap(size=16777216) failed (error code=12)
system.log.0.bz2:Oct 29 14:35:19 macpro coreservicesd[89]: coreservicesd(89,0xa0220fa0) malloc: *** mmap(size=16777216) failed (error code=12)\n*** error: can't allocate region\n*** set a breakpoint in malloc_error_break to debug
system.log.0.bz2:Oct 29 14:35:19 macpro com.apple.coreservicesd[89]: *** set a breakpoint in malloc_error_break to debug


I've looked at vmmap, and while I get the gist of the output, I'm not sure what I should be looking for to see if the process's memory is fragmented. The -submap display shows plenty of small regions, but since I can't do a vmmap "right before I crash", I'm a little stumped...

Can anyone point me at any guidelines, analysis tools, etc?

I suggest keeping top or Activity Monitor around and, when you see a large
growth in RPRVT or when VSIZE gets around ~3GB, capture heap / vmmap / leaks
for the processes of interest and file a bug at <http://bugreport.apple.com/ > with
the collected data, also including pre-existing crashlogs for the given process(es)
and a system profile.


You could also try to figure who are the most frequent callers to mmap in the given
process.
sudo dtrace -n 'syscall::mmap:entry / execname == "<insert name here>" / { @mstacks[ustack()] = count; }'
and Ctrl-C after a bit.


Once you file a bug report, Apple engineers may contact you via bugreporter
and suggest/request further experiments.


   Eric

Jay Levitt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: malloc errors / fragmentation?
      • From: Jay Levitt <email@hidden>
References: 
 >malloc errors / fragmentation? (From: Jay Levitt <email@hidden>)

  • Prev by Date: Re: setuid for priv sockets?
  • Next by Date: Call sequence 'getpwuid(getuid())' unexpectedly returns NULL
  • Previous by thread: malloc errors / fragmentation?
  • Next by thread: Re: malloc errors / fragmentation?
  • Index(es):
    • Date
    • Thread