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

Text component has memory leak on M1 Silicon #1711

Closed
hpaul opened this issue Feb 27, 2022 · 2 comments
Closed

Text component has memory leak on M1 Silicon #1711

hpaul opened this issue Feb 27, 2022 · 2 comments
Labels
Close when stale This issue is going to be closed when there is no activity for a while Missing repro This issue need minimum repro scenario

Comments

@hpaul
Copy link

hpaul commented Feb 27, 2022

Bug

while using react-native-svg library for building graphics in a macOS app, I encountered a problem regarding performance, or a memory leak, don't know how I should call it.

When iterating over an array and mapping values into a component, the application frozens and memory usage goes up-high (>4 gb). I've tried to overcome this, generating the svg using the component, independent component for text, but further it proved that the problem comes from a lower-lever code.

The snippet :

<Svg width={width} height={height}>
  <G y={10}>
    <Path d={`${this.linePath}`} fill="none" stroke="white" strokeWidth="1.5" strokeMiterlimit="20" />
  </G>
  <G y={40}>
    {this.xTicks.map((tick, i) => (
      <G key={i}>
        <Line x1={tick.x} x2={tick.x} y1={tick.y} y2={tick.y + 5} stroke="grey" />
        <SVGText originX={tick.x} originY={tick.y + 20} fill="pink" textAnchor="middle" fontSize={8}>
          {tick.label}
        </SVGText>
      </G>
    ))}
  </G>
</Svg>

As I don't have great skills in low-level languages and don't know how react-native-svg internally works and I'm using a relative new system (M1) together with NSPopover in system tray, I guess it's relatively a unique problem.

How do you think I can debug this?

Screenshot 2022-02-27 at 19 54 28

Environment info

React native info output:

System:
    OS: macOS 12.1
    CPU: (10) arm64 Apple M1 Max
    Memory: 366.59 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    Yarn: Not Found
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.1/bin/npm
    Watchman: 2022.02.14.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /Users/paul/.rvm/gems/ruby-2.7.4/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.2, iOS 15.2, macOS 12.1, tvOS 15.2, watchOS 8.3
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 13.2.1/13C100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.12 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.67.3 => 0.67.3
    react-native-macos: ^0.66.21 => 0.66.21
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 12.1.1

@zgatrying
Copy link

zgatrying commented May 11, 2022

react-navtive-svg: 12.1.0 改变Svg内的Text值也出现了内存泄露的问题。

android: 4.4
react-native: 0.63.4

@bohdanprog
Copy link
Member

Hello @hpaul @zgatrying,
Do you still have that issue?
If you still have that problem, please provide a simple repro for that problem.
thank you.

@bohdanprog bohdanprog added Missing repro This issue need minimum repro scenario Close when stale This issue is going to be closed when there is no activity for a while labels Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close when stale This issue is going to be closed when there is no activity for a while Missing repro This issue need minimum repro scenario
Projects
None yet
Development

No branches or pull requests

3 participants