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.

Importing data via emulator UI causes massive memory usage

See original GitHub issue

[REQUIRED] Environment info

firebase-tools: 8.4.0

Platform: Arch Linux

[REQUIRED] Test case

Export a modest dataset from an existing project. Im my case RTDB json export is 7.5 MB, and my functions count is about 95, with approximately 75% of those are triggers of some sort.

[REQUIRED] Steps to reproduce

Initialize the emulator for RTDB and functions, then start emulator. Import a 7.5mb json file into RTDB. Memory starts increasing at a rate of about 1gb per second, until my OOM manager starts killing processes. My project has about 95 functions, and 75% of those are database triggers. My assumption is that a lot of triggers are firing simultaneously.

[REQUIRED] Expected behavior

This may be a bug, but a feature would be a bootstrap mode that lets me import data without any database triggers firing.

[REQUIRED] Actual behavior

The emulator itself continues to run, by my OOM manager starts killing processes to try to accomodate the memory usage, until pretty much all processes have been killed. The app itself never throws any errors.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
samtsterncommented, Dec 8, 2020

@fpeterdev yes it’s not documented yet (on my to-do list!) but there is a function in @firebase/rules-unit-testing called withFunctionTriggersDisabled() that lets you do this.

Example:

const testing = require('@firebase/rules-unit-testing');

await testing.withFunctionTriggersDisabled(async () => {
  await doSomeDataThing();
  // ...
});

0reactions
fpeterdevcommented, Dec 9, 2020

Thank you! Will such an option be available from the UI during import? We are using the emulator for development as well, and it would be great if we could reload the initial data to the database without restarting the emulator. By the way, this feature would make sense on the “real” firebase console as well. (e.g. for restoring a previous backup)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot known issues with Android Emulator
This page lists known issues, workarounds, and troubleshooting tips for the Android Emulator. If you encounter an issue not listed here or ...
Read more >
Using the Memory view
The memory view provides insights into details of the application's memory allocation and tools to detect and debug specific issues.
Read more >
Memory Insights in Unreal Engine
Memory Insights features a query system that can find live allocations at a certain point in time, recognize increases or decreases in memory...
Read more >
Import Results and Traces into VTune Profiler GUI
Import Raw Trace Data · To reduce the size of the imported data, consider removing the copy of the trace file in the...
Read more >
Memory Profiler module
Part of the extra memory use is because Unity treats objects like textures as read/write enabled in the Editor and keeps an extra...
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