Skip to content

Editing TSX randomly makes the --type=extensionHost process use 100% CPU #21292

Closed

Description

@pocesar
  • VSCode Version: 1.10-Insiders 0b27b5
  • OS Version: windows 10 x64

image
image

import React from 'react'
import {
  View,
  Button,
  TextInput,
  Picker,
  StyleSheet,
  ScrollView,
  Text,
  TouchableOpacity,
  Alert
} from 'react-native'
import t, { FormComponent } from 'tcomb-form-native'
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'

const Model = t.struct({
  cep: t.String,
  neighborhood: t.String,
  name: t.String
})

const Form = t.form.Form

const styles = StyleSheet.create<any>({
  form: {
    padding: 15
  },
})

export default class extends React.Component<any, any> {
  constructor(props) {
    super(props)

    this.state = this.initialState()
  }

  initialState() {
    return {
      form: {
        cep: this.props.defaultCep,
        name: null,
        neighborhood: null,
      },
      disabled: true
    }
  }

  render() {
       return (
      <KeyboardAwareScrollView style={styles.form} keyboardShouldPersistTaps="always">
        <Form
          ref="form"
          type={Model}
          value={this.state.form}
          onChange={(o) =>{ }}
        />

        <View style={{marginVertical: 30}}>
          <Button title="Cadastrar logradouro" disabled={this.state.disabled} onPress={() => {
            Alert.alert('Sucesso', 'Rua cadastrada')

            this.setState(this.initialState())
          }} />
        </View>
      </KeyboardAwareScrollView>
    )
  }
}

Edit <KeyboardAwareScrollView to <View, then edit any children (Form, View) leaving the </KeyboardAwareScrollView> opened, then change it back to <KeyboardAwareScrollView, after a few times, the process will start using 100% CPU. closing the editor won't close the child --type=extensionHost process, and typing on the editor becomes sluggish, all Typescript suggestions stop working

Activity

  1. pocesar commented on Feb 23, 2017

    @pocesar
    Author

    just happened in a much smaller repro code

    image

    in task manager

    image

  2. pocesar commented on Feb 23, 2017

    @pocesar
    Author

    This one became a blocker, everytime when dealing with children of React Native elements, it happens. having to restart the editor every 10 minutes

  3. added
    javascript
    typescript
    on Feb 23, 2017
  4. mjbvz commented on Feb 23, 2017

    @mjbvz
    Contributor

    Paulo Cesar (@pocesar) Does this still happen if you disable all extensions?

  5. pocesar commented on Feb 23, 2017

    @pocesar
    Author

    Yes, but it's harder to reproduce, so some pipes might being clogged (using with --disable-extensions)

    I'm trying to individually enable / disable each extension to see which makes it worse

    EDIT: ok, both Auto close tag and React Native Tools make it hang when starting writing TSX (with <) and trying to press Ctrl + Space

  6. mjbvz commented on Feb 24, 2017

    @mjbvz
    Contributor

    Paulo Cesar (@pocesar) So do you still see this after disabling all extensions?

    If you do, please try collecting a trace of the TypeScript Server when this occurs. Here's information on to do this using the TSS_LOG environment variable: https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29#logging

    From a command line, run:

    set TSS_LOG=-level verbose -file c:\tmp\tsserver.log
    code 
    

    Reproduce the problem in VSCode and then share the c:\tmp\tsserver.log file

    Let me know if you have any questions about this.

    Thanks

  7. pocesar commented on Feb 24, 2017

    @pocesar
    Author

    Matt Bierner (@mjbvz) Yes, I managed to make the external process hang ONCE with all the extensions disabled, but it was a crazy non-sense typing (which I guess wouldn't apply in normal conditions). I couldn't reproduce it again with disabled extensions, but could reproduce it everytime with both extensions (either both enable, or either one, Auto close tag and React Native Tools)

  8. shakram02 commented on Mar 3, 2017

    @shakram02

    I have the same problem on Ubuntu Linux, vs-code version:1.10.1-1488415350 this also happened with previous versions of vs code but it's much more frequent in the newer version
    Typing Angular2 code causes the problem, when this happens, intellisense stops completely ( just displays Loading... )
    first process:
    image
    The process keeps running even after closing vs code, together with (but after I kill the first process they go away ):
    image
    image
    image
    image

  9. added
    bug
    on Apr 20, 2017
  10. pocesar commented on Jun 16, 2017

    @pocesar
    Author

    my insiders, when having TS files open, usually keep a lowish but constant CPU usage, but when using many editors opened at the same time, they add up and the system really take a hit (1-2 cores in use for 30%ish CPU)

    image

    this screenshot is when "idle", not typing or doing anything

  11. pocesar commented on Sep 13, 2017

    @pocesar
    Author

    this seems to have been fixed in latest insiders, although TS in watch mode always make the shell responsiveness inside the editor worst

  12. mjbvz commented on Sep 13, 2017

    @mjbvz
    Contributor

    Ok, thank you for the followup. I'm not sure what fixed this on the TS side but I'm glad you are no longer seeing this issue

  13. locked and limited conversation to collaborators on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugjavascriptperftypescript

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions