当前位置: 首页 > news >正文

[杂谈]Executor-1

为了让Task对象能够重用,在Executor中,每一个分区数据都会有一个Task去进行计算,计算完以后,就要释放taslk的内存,包括堆内和堆外内存,并且,要把Thread-Local的内存也释放掉(TLA)。

org.apache.spark.scheduler.Task
run() {
try {
Utils.tryLogNonFatalError {
// Release memory used by this thread for unrolling blocks
SparkEnv.get.blockManager.memoryStore.releaseUnrollMemoryForThisTask(MemoryMode.ON_HEAP)
SparkEnv.get.blockManager.memoryStore.releaseUnrollMemoryForThisTask(MemoryMode.OFF_HEAP)
// Notify any tasks waiting for execution memory to be freed to wake up and try to
// acquire memory again. This makes impossible the scenario where a task sleeps forever
// because there are no other tasks left to notify it. Since this is safe to do but may
// not be strictly necessary, we should revisit whether we can remove this in the future.
val memoryManager = SparkEnv.get.memoryManager
memoryManager.synchronized { memoryManager.notifyAll() }
}
} finally {
TaskContext.unset()
}
}

转载于:https://www.cnblogs.com/ivanny/p/spark_executor_task_1.html

相关文章:

  • spring中的设计模式
  • SpringMVC+RestFul详细示例实战教程
  • Struts工作原理
  • 【git】git知识梳理(一):基本操作远程控制分支管理
  • Java 反射机制模拟hibernate实现持久化
  • JNDI是什么?
  • OI队测题解:
  • JDBC使用总结
  • freeCodeCamp:Convert HTML Entities
  • JDBC中驱动加载的过程分析(上)
  • JavaScript--substring 和 substr 方法手记
  • 颜色选择器插件
  • JDBC中驱动加载的过程分析(下)
  • 条件控制语句
  • hibernate重要接口说明
  • 《Javascript数据结构和算法》笔记-「字典和散列表」
  • Javascript Math对象和Date对象常用方法详解
  • React组件设计模式(一)
  • Unix命令
  • vue自定义指令实现v-tap插件
  • 从 Android Sample ApiDemos 中学习 android.animation API 的用法
  • 解析带emoji和链接的聊天系统消息
  • 力扣(LeetCode)965
  • 思否第一天
  • 推荐一款sublime text 3 支持JSX和es201x 代码格式化的插件
  • 为什么要用IPython/Jupyter?
  • 中国人寿如何基于容器搭建金融PaaS云平台
  • ​​​​​​​Installing ROS on the Raspberry Pi
  • $.each()与$(selector).each()
  • (27)4.8 习题课
  • (3)STL算法之搜索
  • (DenseNet)Densely Connected Convolutional Networks--Gao Huang
  • (Redis使用系列) Springboot 使用redis的List数据结构实现简单的排队功能场景 九
  • (超详细)2-YOLOV5改进-添加SimAM注意力机制
  • (附源码)ssm基于jsp的在线点餐系统 毕业设计 111016
  • (四)Tiki-taka算法(TTA)求解无人机三维路径规划研究(MATLAB)
  • 、写入Shellcode到注册表上线
  • ..回顾17,展望18
  • .NET Core WebAPI中封装Swagger配置
  • .NET Standard 支持的 .NET Framework 和 .NET Core
  • .Net的C#语言取月份数值对应的MonthName值
  • .NET国产化改造探索(一)、VMware安装银河麒麟
  • .NET教程 - 字符串 编码 正则表达式(String Encoding Regular Express)
  • .net流程开发平台的一些难点(1)
  • @SpringBootApplication 包含的三个注解及其含义
  • []sim300 GPRS数据收发程序
  • [BUG]Datax写入数据到psql报不能序列化特殊字符
  • [codevs] 1029 遍历问题
  • [html] 动态炫彩渐变背景
  • [java] 23种设计模式之责任链模式
  • [JS]Math.random()随机数的二三事
  • [LeetCode] 196. 删除重复的电子邮箱
  • [LeetCode]-283. 移动零-1089. 复写零
  • [LeetCode]-使用特殊算法的题目-2
  • [Linux](16)网络编程:网络概述,网络基本原理,套接字,UDP,TCP,并发服务器编程,守护(精灵)进程