-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
huge memory leak with prepared statements #170
Comments
What do you mean by "huge memory leak"? As in #160, ten times the memory of PostgreSQL is not uncommon. Do you close the prepared statements? On return: Oracle supports returning only one record, the specified fields. What do you try precisely? |
it is exhausting memory very fast ( 8GB ) therefore I try to work with your driver directly in your style if postgres style doesn't work |
this is an example: func (m *SQLStatement) SelectID(tab string, id int) (rows *sql.Rows, err error) {
|
Where do you Close the prepared statement? And the Rows?
volkmarbuehringer <notifications@github.com> ezt írta (időpont: 2017. márc.
10., P 16:07):
… this is an example:
func (m *SQLStatement) SelectID(tab string, id int) (rows *sql.Rows, err
error) {
if m.sqlID == nil {
sqls := fmt.Sprintf("select %s from %s where %s %s order by %s",
strings.Join(m.ColumnsAllType, ","), tab, m.PK[0], EqBindVar+"1",
strings.Join(m.PK, ","))
if m.sqlID, err = DB.Prepare(sqls); err != nil {
return
}
}
rows, err = m.sqlID.Query(id)
return
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#170 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAPoSqKEcrKuqwO388zA1y703CiWMUqTks5rkWccgaJpZM4MYPrT>
.
|
the rows are closed every time after fetch the statement is never closed because it is waiting for executions until end ( which works in postgres ) |
Please Close the statement. Do you SELECT DATE typed columns? |
my program runs with postgres-driver with prepared statements and a footprint of 8 MB
(standard database/sql without any other libraries )
( db.Prepare and then execute stmt.Query very often )
after switching to oracle it has a huge memory leak
without prepared statements it runs fine on oracle ( db.Query )
are prepared statements not supported ?
Another issue is with "insert into returning "
with postgres I execute this Statement with Query and fetch the returned data
with your driver I need to execute with Exec (and additional binds ) and I don't know how to get the returned data
(always database/sql standard library )
The text was updated successfully, but these errors were encountered: