[
https://issues.apache.org/jira/browse/BEAM-5500?focusedWorklogId=149052&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-149052
]
ASF GitHub Bot logged work on BEAM-5500:
----------------------------------------
Author: ASF GitHub Bot
Created on: 28/Sep/18 07:19
Start Date: 28/Sep/18 07:19
Worklog Time Spent: 10m
Work Description: robertwb opened a new pull request #6517: [BEAM-5500]
Fix memory leak in pickler.
URL: https://github.com/apache/beam/pull/6517
We were storing reference to all dicts of modules for pickling,
assuming that the set of modules is bounded. It turns out that
not everything in sys.modules.values is a modue (or static).
------------------------
Follow this checklist to help us incorporate your contribution quickly and
easily:
- [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in
ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA
issue, if applicable. This will automatically link the pull request to the
issue.
- [ ] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
It will help us expedite review of your Pull Request if you tag someone
(e.g. `@username`) to look at it.
Post-Commit Tests Status (on master branch)
------------------------------------------------------------------------------------------------
Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark
--- | --- | --- | --- | --- | --- | --- | ---
Go | [](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/)
| --- | --- | --- | --- | --- | ---
Java | [](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza_Gradle/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/)
Python | [](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/)
| --- | [](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/)
</br> [](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/)
| [](https://builds.apache.org/job/beam_PostCommit_Python_VR_Flink/lastCompletedBuild/)
| --- | --- | ---
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 149052)
Time Spent: 10m
Remaining Estimate: 0h
> Portable python sdk worker leaks memory in streaming mode
> ---------------------------------------------------------
>
> Key: BEAM-5500
> URL: https://issues.apache.org/jira/browse/BEAM-5500
> Project: Beam
> Issue Type: Bug
> Components: sdk-py-harness
> Reporter: Micah Wylde
> Assignee: Robert Bradshaw
> Priority: Major
> Labels: portability-flink
> Attachments: chart.png
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> When using the portable python sdk with flink in streaming mode, we see that
> the python worker processes steadily increase memory usage until they are OOM
> killed. This behavior is consistent across various kinds of streaming
> pipelines, including those with fixed windows and global windows.
> A simple wordcount-like pipeline demonstrates the issue for us (note this is
> run on the [Lyft beam fork|https://github.com/lyft/beam/], which provides
> access to kinesis as a portable streaming source):
> {code:java}
> counts = (p
> | 'Kinesis' >> FlinkKinesisInput().with_stream('test-stream')
> | 'decode' >> beam.FlatMap(decode) # parses from json into python objs
> | 'pair_with_one' >> beam.Map(lambda x: (x["event_name"], 1))
> | 'window' >> beam.WindowInto(window.GlobalWindows(),
> trigger=AfterProcessingTime(15 * 1000),
> accumulation_mode=AccumulationMode.DISCARDING)
> | 'group' >> beam.GroupByKey()
> | 'count' >> beam.Map(count_ones)
> | beam.Map(lambda x: logging.warn("count: %s", str(x)) or x))
> {code}
> When run, we see a steady increase in memory usage in the sdk_worker process.
> Using [heapy|http://guppy-pe.sourceforge.net/#Heapy] I've analyzed the memory
> usage over time and found that it's largely dicts and strings (see attached
> chart).
>
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)