locked
RuntimeBroker consumes large amount of memory (4.5Gb) after running a simple file query RRS feed

  • Question

  • When running a file query, RuntimeBroker.exe grabs 4.5Gb of memory and won't let go until the requesting app exits.

    You can reproduce this using the following code on a PicturesLibrary (or any folder) containing >2000 images of ~6mb each.

                var queryOptions = new QueryOptions
                {
                    ApplicationSearchFilter = "System.Kind:=picture",
                    FolderDepth = FolderDepth.Deep,
                };

                var folder = KnownFolders.PicturesLibrary;
                var query = folder.CreateFileQueryWithOptions(queryOptions);
                var storageFiles = await query.GetFilesAsync();


    Is there a way to avoid this?

    Does this problem exist in Windows 8.1?
    Monday, September 16, 2013 8:11 PM

All replies

  • It's difficult to repro as I don't have a folder with all of those files in it.  Does it repro if you have the files in separate folders?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Tuesday, September 17, 2013 1:04 PM
    Moderator
  • Yes. It will repro so long as there are lots of large files. Those file need not be directly in the root folder, they can be spread out over the root folder's subfolders.

    I've seen RuntimeBroker consume hundreds of mb of memory when running the above code over a few hundred image files, so you may be able to see what I'm talking about without needing to find a few thousand large images.

    Wednesday, September 18, 2013 8:18 PM