Background
Recently, when running sparksql, I frequently print logs and report errors in the middle of execution:
WARN TaskMemoryManager: Failed to allocate a page (104876 bytes), try again.
WARN TaskMemoryManager: Failed to allocate a page (104876 bytes), try again.
…
reason
There is not enough memory to perform tasks, and resources need to be recycled frequently
Solution:
1. Optimize SQL scripts. (preferred, that’s how I solved it at that time)
2. Increase driver memory, — driver memory 6g
My SQL at that time was simplified as follows:
select name
from stu
where id in (select id from in_stu);
Stu data volume is 800W, in_stu data volume is 1.2kW
Optimized as:
select name
from stu
where id in (select distinct id from in_stu);
after optimization, The data volume of In_stu ID is reduced to 11 W, and the problem is solved.
Read More:
- [Solved] Failed to allocate graph: MYRIAD device is not opened.
- [Solved] Kafka Start Log Error: WARN Found a corrupted index file due to requirement failed: Corrupt index found
- [Solved] KEIL Compile Error: Error: L6220E: Load region LR_IROM1 size (65552 bytes) exceeds limit (65536 bytes)……
- [Solved] TensorFlow severing Container Creat Error: failed: Out of range: Read less bytes than requested
- [Solved] Sparksql error: Exception in thread “main” org.apache.spark.sql.catalyst.errors.package$TreeNodeException
- [Solved] redis Error: Can‘t save in background fork Cannot allocate memory
- Python Importerror: DLL load failed: the page file is too small to complete the operation.
- log4j:WARN No appenders could be found for logger (freemarker.cache)
- [Solved] Junit.test use error: log4j:WARN No appenders could be found for logger
- [Solved] Nacos Cluster startup error: error=‘Cannot allocate memory‘ (errno=12)
- [Solved] Error: error getting chaincode bytes: ‘go list‘ failed with: cannot find module providing package
- [Solved] Electron Error: Error: Electron failed to install correctly, please delete node_modules/electron and try
- [Solved] Android7 8 Jack server SSL error: Jack server failed to (re)start, try ‘jack-diagnose’ or see Jack server log
- [Solved] error TS2584: Cannot find name ‘console’. Do you need to change your target library? Try changing the ‘lib’ compiler option to include ‘dom’.
- Nginx: How to Use Error_Page
- [Solved] matlab error: try to write SCRIPT vl_sift is executed as a function
- How to Solve Zeppelin page 503 error
- [Solved] Doris BrokerLoad Error: Scan bytes per broker scanner exceed limit: 3221225472
- How to Fix HTTP Error 500: the default page enter their own routing can’t find a result
- [Elasticsearch Exception]Found interface org.elasticsearch.common.bytes.BytesReference