could not map a view into memory (big red cross)

LexiconLexicon Posts: 110
Hi,

during a profile session (less than 5mins in) I experience the timeline performing slow (read: highlight section and results/source code took a long time to display), then I noticed instead of showing the source I was expecting, a lot of insignificant methods were shown, (screen shot shows that they were supposed to be hidden). Next came an exception window (see images), and the timeline was replaced with the nasty red cross.

now sure if I can reproduce, and this was the first time this happened in an afternoon of intense profiling.

let me know if I can provide any other details.

201008_Session1.jpg

201008_Session11.jpg



Could not map a view into memory.

RedGate.Profiler.Engine.Exceptions.CouldNotMapFileException

at ak.MapView(Int64 start, Int32 length)

at ak.a()

at ak.get_Length()

at al.get_Length()

at ah.Refresh()

at aB.RefreshLightweight()

at bD.c(Graphics )

at bD.OnPaint(PaintEventArgs e, Boolean isRadarPaint)

at bD.OnPaint(PaintEventArgs e)

at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)

at System.Windows.Forms.Control.WmPaint(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

at System.Windows.Forms.ContainerControl.WndProc(Message& m)

at System.Windows.Forms.UserControl.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
OK
Paul.

Comments

  • Bart ReadBart Read Posts: 997 Silver 1
    Hi Paul,


    Thanks for this; it's not something we've seen before so I'm not sure why it's happening but we'll definitely take a look into it. Any chance you could send in your log files to bartDOTreadATredHYPHENgateDOTcom please?


    Thanks,
    Bart
    Bart Read
    Principal Consultant
    bartread.com Ltd
  • Bart, email sent.
    Paul.
  • Bart ReadBart Read Posts: 997 Silver 1
    Hi Paul,



    First off thanks for sending through the log files; they basically confirmed what Andrew suggested to me after I read your post earlier.

    It looks like either ANTS Profiler is running out of memory, or is unable to allocate a contiguous 20 MB block for a memory mapped file. We have seen somewhat similar problems before in testing, and so normally I'd suggest the latter, but it's interesting that the OutOfMemoryExceptions are occurring in the timeline; that could be a side-effect though. Do you happen to have any idea how much memory ANTS Profiler was using when this happened? I'm slightly concerned that in the problem file what we're seeing is only about 15 minutes of usage, which isn't a great deal. Also (apologies if I've asked before), how much memory do you have installed?

    I will say that restarting the profiler and kicking off your profiling session again should fix the problem, although that's clearly not ideal because you're going to lose the data from the session you've been running.


    Thanks,


    Bart
    Bart Read
    Principal Consultant
    bartread.com Ltd
  • Hi Bart,

    4gb ram on machine. I know the code base is quite large so maybe that has a bearing on things?

    I will monitor mem usage over next few sessions and let you know if there is anything strange occurring.

    anything else just drop me a line.
    Paul.
  • Bart ReadBart Read Posts: 997 Silver 1
    Hi Paul,


    Great, thanks. 4 GB should be fine, although .NET processes tend to start playing up at 1.7-1.8 GB on a 32-bit operating system; on a 64-bit OS this shouldn't be an issue at all.

    If the profiler isn't using that much memory then it'll be because down to fragmentation occurring; that's the issue I talked about with the need for the 20 MB contiguous block for the memory mapped file. The thing is that generally fragmentation doesn't become a big issue until the process has swallowed more than 1 GB, so that would still be somewhat odd--there is a very remote chance that it could be an issue at any time though, so maybe it's just that.

    If on the other hand you're seeing extremely high profiler memory usage then it could be one of the following:

    - Extremely complex/very deep call stacks; it's on by default anyway, but if needs be I'd recommend switching on the "Simplify very complex stack traces to save memory".
    - We have a memory leak, although I'd be surprised if the memory usage could build up enough to cause a problem in only ten minutes. Even with complex applications it's extremely rare for ANTS Profiler 4 to use more than 500-600MB on my system, and yours easily has enough headroom to cope with that.

    Hope some of that is helpful.


    Thanks,


    Bart
    Bart Read
    Principal Consultant
    bartread.com Ltd
Sign In or Register to comment.