You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Amit Gupta (JIRA)" <ji...@apache.org> on 2015/05/04 13:37:08 UTC

[jira] [Comment Edited] (SPARK-7337) FPGrowth algo throwing OutOfMemoryError

    [ https://issues.apache.org/jira/browse/SPARK-7337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14526539#comment-14526539 ] 

Amit Gupta edited comment on SPARK-7337 at 5/4/15 11:36 AM:
------------------------------------------------------------

I am running it in "local" mode and using Java API. It should spill over hard-disk. I can clearly see that 500 tasks are not created by next stage hence OutOfMemoryError is coming.

Please let me know if you need further information. I tried to run same logic with custom code with 50 partitions and it worked. When I tried FPGrowth with same data with >50 partitions it failed. Perhaps you need to check why 500 tasks (specified using numPartitions=500) are not created for "collect at FPGrowth.scala:131" (source of error).

Exception in thread "main" org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 8.0 failed 1 times, most recent failure: Lost task 0.0 in stage 8.0 (TID 118, localhost): java.lang.OutOfMemoryError: Java heap space
	at java.util.IdentityHashMap.resize(IdentityHashMap.java:471)
	at java.util.IdentityHashMap.put(IdentityHashMap.java:440)
	at org.apache.spark.util.SizeEstimator$SearchState.enqueue(SizeEstimator.scala:132)
	at org.apache.spark.util.SizeEstimator$$anonfun$visitArray$1.apply$mcVI$sp(SizeEstimator.scala:203)
	at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:141)
	at org.apache.spark.util.SizeEstimator$.visitArray(SizeEstimator.scala:202)
	at org.apache.spark.util.SizeEstimator$.visitSingleObject(SizeEstimator.scala:169)
	at org.apache.spark.util.SizeEstimator$.org$apache$spark$util$SizeEstimator$$estimate(SizeEstimator.scala:161)
	at org.apache.spark.util.SizeEstimator$$anonfun$visitArray$2.apply$mcVI$sp(SizeEstimator.scala:217)
	at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:141)
	at org.apache.spark.util.SizeEstimator$.visitArray(SizeEstimator.scala:210)
	at org.apache.spark.util.SizeEstimator$.visitSingleObject(SizeEstimator.scala:169)
	at org.apache.spark.util.SizeEstimator$.org$apache$spark$util$SizeEstimator$$estimate(SizeEstimator.scala:161)
	at org.apache.spark.util.SizeEstimator$.estimate(SizeEstimator.scala:155)
	at org.apache.spark.util.collection.SizeTracker$class.takeSample(SizeTracker.scala:78)
	at org.apache.spark.util.collection.SizeTracker$class.afterUpdate(SizeTracker.scala:70)
	at org.apache.spark.util.collection.SizeTrackingAppendOnlyMap.changeValue(SizeTrackingAppendOnlyMap.scala:33)
	at org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:205)
	at org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:56)
	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68)
	at org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
	at org.apache.spark.scheduler.Task.run(Task.scala:64)
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:203)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Driver stacktrace:
	at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGScheduler$$failJobAndIndependentStages(DAGScheduler.scala:1204)
	at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1193)
	at org.apache.spark.scheduler.DAGScheduler$$anonfun$abortStage$1.apply(DAGScheduler.scala:1192)
	at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
	at org.apache.spark.scheduler.DAGScheduler.abortStage(DAGScheduler.scala:1192)
	at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:693)
	at org.apache.spark.scheduler.DAGScheduler$$anonfun$handleTaskSetFailed$1.apply(DAGScheduler.scala:693)
	at scala.Option.foreach(Option.scala:236)
	at org.apache.spark.scheduler.DAGScheduler.handleTaskSetFailed(DAGScheduler.scala:693)
	at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1393)
	at org.apache.spark.scheduler.DAGSchedulerEventProcessLoop.onReceive(DAGScheduler.scala:1354)
	at org.apache.spark.util.EventLoop$$anon$1.run(EventLoop.scala:48)
15/05/04 17:04:12 INFO Executor: Running task 4.0 in stage 8.0 (TID 122)
15/05/04 17:04:12 ERROR Executor: Exception in task 4.0 in stage 8.0 (TID 122)
org.apache.spark.TaskKilledException
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:194)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
15/05/04 17:04:12 WARN TaskSetManager: Lost task 4.0 in stage 8.0 (TID 122, localhost): org.apache.spark.TaskKilledException
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:194)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)



was (Author: amit.gupta.niit-tech):
I am running it in "local" mode and using Java API. It should spill over hard-disk. I can clearly see that 500 tasks are not created by next stage hence OutOfMemoryError is coming.

Please let me know if you need further information. I tried to run same logic with custom code with 50 partitions and it worked. When I tried FPGrowth with same data with >50 partitions it failed. Perhaps you need to check why 500 tasks are not created for "collect at FPGrowth.scala:131" (source of error).

> FPGrowth algo throwing OutOfMemoryError
> ---------------------------------------
>
>                 Key: SPARK-7337
>                 URL: https://issues.apache.org/jira/browse/SPARK-7337
>             Project: Spark
>          Issue Type: Bug
>          Components: MLlib
>    Affects Versions: 1.3.1
>         Environment: Ubuntu
>            Reporter: Amit Gupta
>         Attachments: FPGrowthBug.png
>
>
> When running FPGrowth algo with huge data in GBs and with numPartitions=500 then after some time it throws OutOfMemoryError.
> Algo runs correctly upto "collect at FPGrowth.scala:131" where it creates 500 tasks. It fails at next stage "flatMap at FPGrowth.scala:150" where it fails to create 500 tasks and create some internal calculated 17 tasks.
> Please refer to attachment - print screen.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org