Skip to content
This repository has been archived by the owner on Oct 30, 2023. It is now read-only.

long lines cause memory use to balloon #17

Open
joeyh opened this issue Jan 1, 2012 · 0 comments
Open

long lines cause memory use to balloon #17

joeyh opened this issue Jan 1, 2012 · 0 comments

Comments

@joeyh
Copy link

joeyh commented Jan 1, 2012

perl -e 'use Text::Markdown "markdown"; markdown("a" x 6000000)'

This command feeds 6 mb of data to markdown, which takes 200 mb of memory to process it.

Most of the problem seems to be caused by the very long line. The same amount of data in short lines needs only 45 mb of memory.

perl -e 'use Text::Markdown "markdown"; markdown("a\n" x 3000000)'

While doubling the length of the single line nearly doubled the memory needed, to 385 mb.

perl -e 'use Text::Markdown "markdown"; markdown("a" x 12000000)'

This was observed in the wild, where a spammer DOSed a wiki by entering a single 6 mb long line into it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant