{"action":"created","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/12265","repository_url":"https://api.github.com/repos/pydata/pandas","labels_url":"https://api.github.com/repos/pydata/pandas/issues/12265/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/12265/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/12265/events","html_url":"https://github.com/pydata/pandas/issues/12265","id":132372202,"number":12265,"title":"Reading table with chunksize still pumps the memory","user":{"login":"klonuo","id":361447,"avatar_url":"https://avatars.githubusercontent.com/u/361447?v=3","gravatar_id":"","url":"https://api.github.com/users/klonuo","html_url":"https://github.com/klonuo","followers_url":"https://api.github.com/users/klonuo/followers","following_url":"https://api.github.com/users/klonuo/following{/other_user}","gists_url":"https://api.github.com/users/klonuo/gists{/gist_id}","starred_url":"https://api.github.com/users/klonuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klonuo/subscriptions","organizations_url":"https://api.github.com/users/klonuo/orgs","repos_url":"https://api.github.com/users/klonuo/repos","events_url":"https://api.github.com/users/klonuo/events{/privacy}","received_events_url":"https://api.github.com/users/klonuo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/IO%20SQL","name":"IO SQL","color":"5319e7"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Usage%20Question","name":"Usage Question","color":"0052cc"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pydata/pandas/milestones/33","html_url":"https://github.com/pydata/pandas/milestones/No%20action","labels_url":"https://api.github.com/repos/pydata/pandas/milestones/33/labels","id":997544,"number":33,"title":"No action","description":"A milestone for closed or open issues for which there is no action needed (eg not a bug, just a question / discussion, nothing to resolve, wontfix, etc).\r\n\r\n","creator":{"login":"jorisvandenbossche","id":1020496,"avatar_url":"https://avatars.githubusercontent.com/u/1020496?v=3","gravatar_id":"","url":"https://api.github.com/users/jorisvandenbossche","html_url":"https://github.com/jorisvandenbossche","followers_url":"https://api.github.com/users/jorisvandenbossche/followers","following_url":"https://api.github.com/users/jorisvandenbossche/following{/other_user}","gists_url":"https://api.github.com/users/jorisvandenbossche/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisvandenbossche/subscriptions","organizations_url":"https://api.github.com/users/jorisvandenbossche/orgs","repos_url":"https://api.github.com/users/jorisvandenbossche/repos","events_url":"https://api.github.com/users/jorisvandenbossche/events{/privacy}","received_events_url":"https://api.github.com/users/jorisvandenbossche/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":110,"state":"open","created_at":"2015-02-26T19:29:05Z","updated_at":"2016-02-09T10:56:56Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2016-02-09T09:39:47Z","updated_at":"2016-02-09T11:07:43Z","closed_at":"2016-02-09T10:47:25Z","body":"I'm trying to migrate database tables from MySQL to SQL Server:\r\n\r\n```python\r\nimport pandas as pd\r\nfrom sqlalchemy import create_engine\r\n\r\nmy_engine = create_engine(\"mysql+pymysql://root:pass@localhost/gen\")\r\nms_engine = create_engine('mssql+pyodbc://localhost/gen?driver=SQL Server')\r\n\r\nfor table_name in ['topics', 'fiction', 'compact']:\r\n    for table in pd.read_sql_query('SELECT * FROM %s' % table_name,\r\n                                   my_engine, \r\n                                   chunksize=100000):\r\n\r\n        table.to_sql(name=table_name, con=ms_engine, if_exists='append')\r\n```\r\n\r\nI thought that using chunksize would release the memory, but it's just growing up.\r\nI tried also garbage collector, but it has no effect.\r\n\r\nMaybe my expectations were wrong?\r\n\r\n_I'm using Python 3.5.1 with pandas 0.17.1 and all latest packages, although I tried also Python 2.7 with pandas 0.16 and same results_ "},"comment":{"url":"https://api.github.com/repos/pydata/pandas/issues/comments/181818257","html_url":"https://github.com/pydata/pandas/issues/12265#issuecomment-181818257","issue_url":"https://api.github.com/repos/pydata/pandas/issues/12265","id":181818257,"user":{"login":"klonuo","id":361447,"avatar_url":"https://avatars.githubusercontent.com/u/361447?v=3","gravatar_id":"","url":"https://api.github.com/users/klonuo","html_url":"https://github.com/klonuo","followers_url":"https://api.github.com/users/klonuo/followers","following_url":"https://api.github.com/users/klonuo/following{/other_user}","gists_url":"https://api.github.com/users/klonuo/gists{/gist_id}","starred_url":"https://api.github.com/users/klonuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klonuo/subscriptions","organizations_url":"https://api.github.com/users/klonuo/orgs","repos_url":"https://api.github.com/users/klonuo/repos","events_url":"https://api.github.com/users/klonuo/events{/privacy}","received_events_url":"https://api.github.com/users/klonuo/received_events","type":"User","site_admin":false},"created_at":"2016-02-09T11:07:43Z","updated_at":"2016-02-09T11:07:43Z","body":"PG example parameters for this example would be very nice ;)"}}