question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

High CPU Usage when parsing fails?

See original GitHub issue

This was reported on Slack and I think I found one way to reproduce it reliably, if anyone else can try it out it would be good to have confirmation!

Steps to Reproduce

  1. git clone https://github.com/rtfeldman/elm-spa-example
  2. Open the project in an editor with the language server enabled.
  3. Open src/Main.elm
  4. Give it a second for the warnings to show up
  5. Delete from line 1 to line 35 (this block below)
module Main exposing (main)

import Api exposing (Cred)
import Article.Slug exposing (Slug)
import Avatar exposing (Avatar)
import Browser exposing (Document)
import Browser.Navigation as Nav
import Html exposing (..)
import Json.Decode as Decode exposing (Value)
import Page exposing (Page)
import Page.Article as Article
import Page.Article.Editor as Editor
import Page.Blank as Blank
import Page.Home as Home
import Page.Login as Login
import Page.NotFound as NotFound
import Page.Profile as Profile
import Page.Register as Register
import Page.Settings as Settings
import Route exposing (Route)
import Session exposing (Session)
import Task
import Time
import Url exposing (Url)
import Username exposing (Username)
import Viewer exposing (Viewer)



-- NOTE: Based on discussions around how asset management features
-- like code splitting and lazy loading have been shaping up, it's possible
-- that most of this file may become unnecessary in a future release of Elm.
-- Avoid putting things in this module unless there is no alternative!
-- See https://discourse.elm-lang.org/t/elm-spa-in-0-19/1800/2 for more.
  1. CPU usage will spike to 99% and stay there, even if you undo the changes, it seems like you have to kill and restart the language server.

From taking a profile while this is happening it looks like this is the callstack, it gets stuck somewhere in trying to find a function. image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
razzeeecommented, Jul 31, 2019

If you can, please test with master. I will very likely prepare a release very soon.

1reaction
ymtszwcommented, Aug 2, 2019

Re-enabled for a whole work way, and it works smooth! (VSCode 1.36.1) Deeply appreciated ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix high Java CPU usage problems - TheServerSide.com
One of the first indicators of a runtime performance problem is a high Java CPU usage report from a JVM profiler or Java...
Read more >
large string data parsing causing high-cpu usage
String parsing always generates 100% cpu usage, you are asking it do do real work. Finding out why you lose 40-30% should be...
Read more >
CPU usage keeps increasing · Issue #1878 - GitHub
I have this problem too my parse server version is 2.2.17 and its working with 2 core 7gb ram.Also I'm using pm2 but...
Read more >
FIX: Internet Explorer may use a high percentage of the CPU ...
Describes a problem in which Internet Explorer may consume a high percentage of the CPU resources after you receive a 404 error message....
Read more >
Hunting and Analyzing High CPU Usage in .NET Applications
The one we implemented first was to lock and synchronize access to the dictionary at the cost of losing performance. The server was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found