Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakpoint in HTML DSL with Ktor-Server causes IntelliJ Debugger to hog memory and hang with "Collecting data" message #149

Open
lehnerpat opened this issue Jun 1, 2020 · 0 comments

Comments

@lehnerpat
Copy link

lehnerpat commented Jun 1, 2020

Reproduction Steps

  • Have a Gradle project with Kotlin (JVM), Ktor and ktor-html-builder / kotlinx-html open in IntelliJ IDEA
  • Use call.respondHtml() to build the response using HTML DSL, as describe here on the Ktor docs
  • Place a breakpoint somewhere in the HTML DSL (see screenshot for example)
    • Note: this is inside of a suspend function
  • Trigger the route with a matching request

Expected Result

  • The IDE stops at the breakpoint
  • The debugger shows the values of any variables in scope in the "Variables" section, like any other regular breakpoint

Actual Result

  • The IDE stops at the breakpoint
  • The debugger shows the (names of the) variables in the "Variables" section
  • But no values are shown at first; instead, the text "Collecting data..." is shown
  • (Note: in some situations, I have observed that not even the list of variables is shown immediately, instead showing a single "Collecting data..." in its place)
  • The debugger takes several minutes, during which CPU usage is very high (>80% of multiple cores) and memory usage keeps increasing (the IDE shows a hint at some point that its allocated memory is insufficient).

hanging-debugger

Further Notes

Version Info:

  • OS: macOS 10.15.4
  • IDE: IntelliJ IDEA 2020.1.1 (Community Edition) (Build #IC-201.7223.91, Runtime version: 11.0.6+8-b765.40 x86_64, VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o)
  • JDK: adopt-openjdk-1.8.0_252
  • Kotlin: observed on 1.3.70 and 1.3.72
  • Ktor-server: 1.3.2 with ktor-server-netty engine
  • kotlinx-html: 0.7.1

Reproduction Example

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

No branches or pull requests

1 participant