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

fix: memory leak when useing in ssr #235

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CjLaunch
Copy link

@John60676
Copy link
Member

能否给个重现示例

@CjLaunch
Copy link
Author

CjLaunch commented Apr 24, 2024

这个需要通过拿到内存的快照来确认内存泄漏,即使给重现示例也很难确认有内存泄漏;内存泄漏的主要原因就是在 node 端调用 subscriber 方法,导致 queryInstance 实例无法被销毁。

@John60676
Copy link
Member

是的,正因为是这个问题难以复现,所以才希望你能提供一个示例,让我完善一下测试用例

@CjLaunch
Copy link
Author

CjLaunch commented Apr 24, 2024

我这边就是直接在 node 端使用 useRequest 的,没有任何黑操作,示例也是 ssr 服务中使用 useRequest,例如

useRequest(({ userId, page }: { userId: string; page?: number }) => fetch({
    params: {
      userId,
      num: pageSize,
      page: page || 1,
    },
  }), {
    manual: true,
  })

@John60676
Copy link
Member

感谢❤️,我会尽快确认问题,处理该pr

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.

None yet

2 participants