Skip to content

Fix: disable tracing when heap size limit is reached#972

Open
GuzekAlan wants to merge 22 commits intomainfrom
956-livedebugger-is-making-the-system-run-slow-and-memory-is-growing-rapidly
Open

Fix: disable tracing when heap size limit is reached#972
GuzekAlan wants to merge 22 commits intomainfrom
956-livedebugger-is-making-the-system-run-slow-and-memory-is-growing-rapidly

Conversation

@GuzekAlan
Copy link
Copy Markdown
Contributor

No description provided.

@GuzekAlan GuzekAlan marked this pull request as ready for review April 13, 2026 15:06
@GuzekAlan GuzekAlan requested a review from Copilot April 13, 2026 15:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds safeguards and UX feedback around the callback tracer to prevent excessive memory usage: it applies heap limits to tracer-related processes, detects when the dbg tracer dies, and surfaces a UI popup to let users re-enable tracing.

Changes:

  • Add max heap size configuration for tracer processes and manage tracer restarts/disabled state via a new DbgKilled event.
  • Introduce a TracingCrashPopup hook component and integrate it into key LiveViews to show when tracing has been disabled.
  • Refactor/adjust tests and dev tooling (memory repro LiveView, LiveDashboard route) to support the new behavior.

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/services/callback_tracer/gen_servers/tracing_manager_test.exs Refactors setup expectations and updates refreshed-trace test flow.
test/services/callback_tracer/actions/tracing_test.exs Updates tracer init argument expectations; removes refresh_tracing/0 tests.
mix.lock Adds lock entries for LiveDashboard dependencies.
mix.exs Adds phoenix_live_dashboard dependency for dev/test.
lib/live_debugger/utils/memory.ex Adds helper to set :max_heap_size process flag in GB.
lib/live_debugger/services/callback_tracer/process/tracer.ex Initializes heap limit for the :dbg.tracer process via an init-state wrapper.
lib/live_debugger/services/callback_tracer/gen_servers/tracing_manager.ex Adds tracer_started?/0, restarts tracing on refresh, and broadcasts DbgKilled on tracer down.
lib/live_debugger/services/callback_tracer/gen_servers/trace_handler.ex Applies heap limit, subscribes to bus events, and terminates on DbgKilled.
lib/live_debugger/services/callback_tracer/events.ex Adds DbgKilled event definition.
lib/live_debugger/services/callback_tracer/actions/tracing.ex Restarts tracer by stopping existing dbg + starting with init state wrapper; tightens refresh_tracing/1 guard.
lib/live_debugger/app/web/components/tracing_crash_popup.ex New popup hook component to show tracing-disabled state and allow re-enable.
lib/live_debugger/app/web/components.ex Hides popup close icon when no on_close is provided.
lib/live_debugger/app/settings/web/settings_live.ex Integrates tracing crash popup into Settings LiveView.
lib/live_debugger/app/discovery/web/discovery_live.ex Integrates tracing crash popup into Discovery LiveView.
lib/live_debugger/app/debugger/web/debugger_live.ex Integrates tracing crash popup into Debugger LiveView; removes catch-all handle_info.
lib/live_debugger/app/debugger/callback_tracing/web/hooks/display_new_traces.ex Makes trace streaming helpers nil-safe and uses is_trace/1 guard.
dev/router.ex Adds routes for memory repro LiveView and LiveDashboard.
dev/live_views/memory_explosion.ex New LiveView to reproduce memory-heavy behavior.
dev/layout.ex Adds a client hook that auto-pushes tick events for the memory repro view.
dev/components.ex Adds the new dev route to the dev navigation list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GuzekAlan GuzekAlan requested a review from Copilot April 14, 2026 12:30
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 20 out of 21 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@GuzekAlan GuzekAlan requested review from hhubert6 and kraleppa April 14, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants