App Crash after querying thousands of records (mySQL)
See original GitHub issueApp is crashing after querying a simple select, which returns more than 185446 records.
The select is simple: select * from table where foreign_key = 1
Database: MYSQL
========== Log Below ==================
Process: Sqlectron [4366] Path: /opt/homebrew-cask/*/Sqlectron.app/Contents/MacOS/Sqlectron Identifier: org.sqlectron.gui Version: 1.7.0 (1.7.0.76) Code Type: X86-64 (Native) Parent Process: ??? [1] Responsible: Sqlectron [4366] User ID: 501
Date/Time: 2016-04-27 15:29:23.244 -0300 OS Version: Mac OS X 10.11.4 (15E65) Report Version: 11 Anonymous UUID: DB8C8B51-673C-1D32-89CA-B442454AA8D1
Time Awake Since Boot: 27000 seconds
System Integrity Protection: enabled
Crashed Thread: 0 CrBrowserMain Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_INSTRUCTION (SIGILL) Exception Codes: 0x0000000000000001, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY
Thread 0 Crashed:: CrBrowserMain Dispatch queue: com.apple.main-thread 0 com.github.electron.framework 0x000000010e1c2ac4 0x10e0f7000 + 834244 1 com.github.electron.framework 0x000000010e1c2ab9 0x10e0f7000 + 834233 2 libnode.dylib 0x0000000112621f81 v8::internal::V8::FatalProcessOutOfMemory(char const_, bool) + 593 3 libnode.dylib 0x00000001127d377e v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) + 542 4 libnode.dylib 0x0000000112a664d9 v8::internal::Runtime_StringBuilderJoin(int, v8::internal::Object__, v8::internal::Isolate_) + 521
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
I have spent some time trying to figure out the best way to replace the IPC call with data stream. These are the results of the tests with stream for each client:
Since only one client has support for streaming multiple query statements (based on what I have tested). I don’t think is worth changing the process to execute queries with stream and Promise support. Also this problem only occur on selecting hundred thousand rows. Which should be avoid most of the time. Therefore, right now I will not work on this issue. But I will let this issue open, in case we find a better solution in the future.
Debugging the problem. Seems like the memory leak happens on electron while it prepares the response from the main process to the renderer process. I’m planing in replacing the remote IPC calls with HTTP requests over a HTTP server running in the main process. It would allow use streams to response the query results. Which I guess would fix this problem. I still testing this approach. Lets see if it works. But I guess it will. Because IPC calls are not recommended way to transfer large data.