Memory leaks report on pluck

Open
#362 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
sqlite, swift
Domain
database

Research direction

Start by reproducing the two reported cases around db.pluck(expression) with Instruments, comparing the version with the row access and update against the commented version. Trace whether the reported allocations originate in SQLite.swift or the caller’s query and update usage. Done means identifying a reproducible leak cause and documenting or fixing it with evidence from the Instruments reports.

Written by the indexing model from the issue text.

Description

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?

Dominant language
Swift
Stars
10.2k
Forks
1.6k
Avg merge
6d 2h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stephencelis/SQLite.swift

All issues in stephencelis/SQLite.swift

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.