diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 1188d27b..92351bcc 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -3870,9 +3870,17 @@ void View::DrawMemory() ImGui::Separator(); if( ImGui::TreeNode( "Active allocations" ) ) { - ListMemData( mem.active.begin(), mem.active.end(), []( auto& v ) { - ImGui::Text( "0x%" PRIx64, v->second->ptr ); - return v->second; + std::vector items; + items.reserve( mem.active.size() ); + for( auto& v : mem.active ) + { + items.emplace_back( v.second ); + } + std::sort( items.begin(), items.end(), []( const auto& lhs, const auto& rhs ) { return lhs->timeAlloc > rhs->timeAlloc; } ); + + ListMemData( items.begin(), items.end(), []( auto& v ) { + ImGui::Text( "0x%" PRIx64, (*v)->ptr ); + return *v; } ); ImGui::TreePop(); }