i’m using a sqlite database with sql.js library in a electron project. when i need to update my db, i call a SOAP service which returns a JSON formatted string with all the query that i need to set like this:
[
{
{TABLE:"table1"},
{OP:["INSERT INTO…","INSERT INTO…",etc…]}
},
{
{TABLE:"table2"},
{OP:["INSERT INTO…","INSERT INTO…",etc…]}
}
]
the total amount of records to be insert is about 400k (but it can grow in the future)
when i call the SOAP service, it throws me an error:
> <--- Last few GCs --->
> 125053 ms: Mark-sweep 1247,0 (1301,1) -> 1089,3 (1143,4) MB, 440,5 / 0,0 ms [allocation failure] [GC in old space requested].
> 125173 ms: Mark-sweep 1089,3 (1143,4) -> 1089,0 (1143,4) MB, 119,8 / 0,0 ms [allocation failure] [GC in old space requested].
> 125287 ms: Mark-sweep 1089,0 (1143,4) -> 1089,0 (1104,4) MB, 113,6 / 0,0 ms [last resort gc].
> 125384 ms: Mark-sweep 1089,0 (1104,4) -> 1089,0 (1104,4) MB, 97,6 / 0,0 ms [last resort gc].
> <--- JS stacktrace --->
> ==== JS stack trace =========================================
> Security context: 0x13047a0cc421 <JS Object>
> 2: wb [/Users/gaetano/Desktop/sqlite/node_modules/sql.js/js/sql.js:~350] [pc=0x24ced26fb87](this=0x2ecf4e3070e9 <an Object with map 0xc5e4890dfc9>,a=0x17e1a2e49d41 <a dc with map 0xf7c43efd9f9>)
> 3: Sa [/Users/gaetano/Desktop/sqlite/node_modules/sql.js/js/sql.js:~350] [pc=0x24cec57039a](this=0x2ecf4e3070e9 <an Object with map 0xc5e4890dfc9>,a=0x17e1a2e49d41 <a dc with map 0xf7c43efd9f9>,...
it’s not clear for me if it’s from a nodejs lack of memory or sqlite.
is there something that i can “increase” like a pragma statement or something like that?!
thank you!