Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

std::bad_alloc on 150 parallel connections #55

Open
muodov opened this issue Aug 1, 2014 · 1 comment
Open

std::bad_alloc on 150 parallel connections #55

muodov opened this issue Aug 1, 2014 · 1 comment

Comments

@muodov
Copy link

muodov commented Aug 1, 2014

The following code raises std::bad_alloc on 151st iteration (32bit Ubuntu 12.04 with 4Gb RAM). I think 15 is not too many...

tdbs = []
for i in xrange(100000):
        print i
        db = umysql.Connection()
        db.connect(SQL_HOST, SQL_PORT, SQL_USER, SQL_PASSWD, SQL_DB)
        tdbs.append(db)
@Jahaja
Copy link
Member

Jahaja commented Oct 20, 2014

ultramysql will preallocate 20MB worth of transaction buffers for each connection. So it's likely that you're just running out of memory.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants