Skip to content

Deprecated ruby API use - possible memory issues #493

@blechereyal

Description

@blechereyal

Environment

Operating System

No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.6 LTS
Release:        14.04
Codename:       trusty
Linux homer-eblecher 3.13.0-170-generic #220-Ubuntu SMP Thu May 9 12:40:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

TinyTDS Version and Information

 Version: freetds v1.00.21
freetds.conf directory: /usr/local/etc
MS db-lib source compatibility: no
Sybase binary compatibility: no
Thread safety: yes
iconv library: yes
TDS version: 7.3
iODBC: no
unixodbc: no
SSPI "trusted" logins: no
Kerberos: no
OpenSSL: no
GnuTLS: no
MARS: no

FreeTDS Version

1.00.21

Description

I'm not positive about this, but someone with more experience here could validate/invalidate this. I noticed some fairly significant memory usage when using tiny-tds (wrapped by the activerecord sql adapter gem) within sidekiq. I profiled this activity and it turned out to be mostly creation of strings from within result.c (putting the profile here - profiled via jemalloc profiling tools).

The behaviour was mostly that when using db heavy code i would see huge bursts of memory without any subsequent downscaling of the RSS. I noticed that we're using a deprecated api with Data_Make_Struct which now looks like should be TypedData_Make_Struct.Could this be an issue in a multithreaded environment and could this new api improve things ?

profile.pdf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions