Skip to content

read_tsv leaks memory when reading from character vectors. #1092

Description

@Shians

I'm finding when running read_tsv on character vectors in a loop, the memory usage will keep growing. I don't really have much experience with diagnosing memory issues so here I'm just relying on gc()'s report of memory usage.

dummy <- rep("a\tb\tc\t1\t2\t3\n", 1000000)

for (i in 1:5) {
    readr::read_tsv(dummy, col_names = FALSE)
    print(gc())
}

On my machine (Ubuntu) this grows the memory used by 5mb each run, whereas read.table does not.

for (i in 1:5) {
    read.table(textConnection(dummy), header = FALSE, sep = "\t")
    print(gc())
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions