lunarmodules / luasql

LuaSQL is a simple interface from Lua to a DBMS.
http://lunarmodules.github.io/luasql
539 stars 191 forks source link

Out of Memory #22

Open kirubz opened 9 years ago

kirubz commented 9 years ago

I am receiving Out of Memory issue while executing queries using LuaSQL. Can any one please help me on this. I have closed the connection properly, but still i am receiving this error.

tomasguisasola commented 9 years ago
Hi Kirubaharan

Could you provide us an example?  What driver are you using?

Regards,
    Tomás

On Tue, 21 Oct 2014, Kirubaharan Palani wrote:

I am receiving Out of Memory issue while executing queries using LuaSQL. Can any one please help me on this. I have closed the connection properly, but still i am receiving this error.


Reply to this email directly or view it on GitHub: https://github.com/keplerproject/luasql/issues/22

kirubz commented 9 years ago

Hi Tomas, Sorry for the delay, Actually I used "luasql.mysql" to connect the database. Its working well, if I continuously access and insert data into database its producing "LuaSQL: error connecting: Out of memory" error and also Its not producing daily, in some scenarios only its producing.

Main Scenario: I have hosted multiple application in single server. Server Information:

  1. Apache 2.2,
  2. MySQL,
  3. Lua5.1 Regards, Kirubaharan Palani
tomasguisasola commented 9 years ago
Hi Kirubaharan

Since the problem occurs when you "continuously access and

insert data", it seems to that maybe you are not closing your cursors. Some systems are quite sensible to that situation. Can you check that?

Regards,
    Tomás

On Sat, 25 Oct 2014, Kirubaharan Palani wrote:

Hi Tomas, Sorry for the delay, Actually I used "luasql.mysql" to connect the database. Its working well, if I continuously access and insert data into database its producing "LuaSQL: error connecting: Out of memory" error and also Its not producing daily, in some scenarios only its producing.

Main Scenario: I have hosted multiple application in single server. Server Information:

  1. Apache 2.2,
  2. MySQL,
  3. Lua5.1 Regards, Kirubaharan Palani

Reply to this email directly or view it on GitHub: https://github.com/keplerproject/luasql/issues/22#issuecomment-60476046

kirubz commented 9 years ago

Thanks Tomás, I will check and let you know how its performs. Once again thanks a lot.

DrAndyArmstrong commented 9 years ago

Kirubz,

Sounds potentially like a socket/file handle leak if they are not closed. I have made the same mistake of thinking closing the connection would bring down the cursors, but that was a silly assumption.

All fd should be closed really, but I think open connections reveal themselves quite quickly as mySQL will show them as inactive connections, but the cursor leak would be hard to spot!

jianren8023 commented 9 years ago

hi Kirubz, i have the same issue. Do you find out what's the problem finally?

tomatolog commented 7 years ago

here is a script that you might issue as lua con1.lua 1025

and see that iterations up to 1024 passed well then got error reply LuaSQL: error connecting: Out of memory

and that issue is fixed after apply patch from #69