SQLite.swift icon indicating copy to clipboard operation
SQLite.swift copied to clipboard

Memory leaks report on pluck

Open roma86 opened this issue 9 years ago • 4 comments

Hello. Thank you for great tool. I have question about instruments report. I have question about query, reported as leaked in instruments

if let row = db.pluck(expression) {
            //word = row[c_word]

            //let now = NSDate().timeIntervalSince1970
            //try db.run(t_words.filter(c_id == row[c_id]).update(c_ai_used_at <- now))
}

if all lines in if block commented, this is how instruments report looks like:

img_1 call_tree_1

if let row = db.pluck(expression) {
            word = row[c_word]

            let now = NSDate().timeIntervalSince1970
            try db.run(t_words.filter(c_id == row[c_id]).update(c_ai_used_at <- now))
}

if all lines in if block uncommented, this is how instruments report looks like:

img_2 call_tree_2

Have idea what of errors in my code generate this leaks?

roma86 avatar Feb 23 '16 17:02 roma86

@roma86 Hi,

I am currently experiencing the same issue. Did you find something about it since you created this ticket ?

@stephencelis Do you have any idea ?

craigzour avatar Jul 12 '16 19:07 craigzour

@craigzour hello. nope, i just moved to the GRDB lib and stop to investigate.

roma86 avatar Jul 12 '16 19:07 roma86

@roma86 Oh I see. And you do not have any leak at all with this new library ?

craigzour avatar Jul 12 '16 19:07 craigzour

@craigzour i can not answer right now, some water is gone from that time. as i can remember there are was some other issues as well which improve my choice to move another lib and i like simple nature of grdb and they say it is match faster. But grdb required slightly more work (fe: models are not so handy as SQLite). You can test it by self with simple clean project and common sql tasks, this should not be hard. I do not want to lie you about leaks in reason i can not remember exactly.

roma86 avatar Jul 12 '16 19:07 roma86