请教POSTGRESQL 9.1.6 执行大量inesrt的时候内存溢出的问题

letheanwater 2014-07-17 02:11:00
请教一下,postgresql在执行大量的空间查询和insert的时候,内存溢出导致server progress crash。
尝试加大share buffer时,超过1G,就会无法启动postgresql

抛错日志如下。。
SPI TupTable: 8192 total in 1 blocks; 6824 free (0 chunks); 1368 used
SPI TupTable: 8192 total in 1 blocks; 6824 free (0 chunks); 1368 used
SPI TupTable: 8192 total in 1 blocks; 6824 free (0 chunks); 1368 used
MessageContext: 24576 total in 2 blocks; 19128 free (6 chunks); 5448 used
Operator class cache: 8192 total in 1 blocks; 4872 free (0 chunks); 3320 used
smgr relation table: 8192 total in 1 blocks; 760 free (0 chunks); 7432 used
TransactionAbortContext: 32768 total in 1 blocks; 32752 free (0 chunks); 16 used
Portal hash: 8192 total in 1 blocks; 3912 free (0 chunks); 4280 used
PortalMemory: 8192 total in 1 blocks; 7768 free (1 chunks); 424 used
PortalHeapMemory: 7168 total in 3 blocks; 1640 free (0 chunks); 5528 used
ExecutorState: 32832 total in 3 blocks; 5384 free (1 chunks); 27448 used
LOG: server process (PID 11452) was terminated by exception 0xC0000005
HINT: See C include file "ntstatus.h" for a description of the hexadecimal value.
LOG: terminating any other active server processes
WARNING: terminating connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to roll back the current transaction and e
xit, because another server process exited abnormally and possibly corrupted shared memory.
HINT: In a moment you should be able to reconnect to the database and repeat your command.
WARNING: terminating connection because of crash of another server process
DETAIL: The postmaster has commanded this server process to roll back the current transaction and e
xit, because another server process exited abnormally and possibly corrupted shared memory.
HINT: In a moment you should be able to reconnect to the database and repeat your command.
LOG: all server processes terminated; reinitializing
LOG: database system was interrupted; last known up at 2014-07-17 13:46:05 HKT
LOG: database system was not properly shut down; automatic recovery in progress
LOG: redo starts at 1/D104A18
LOG: record with zero length at 1/D10C980
LOG: redo done at 1/D10C940
LOG: last completed transaction was at log time 2014-07-17 13:57:03.486+08
LOG: database system is ready to accept connections
LOG: autovacuum launcher started

还有一种日志是在sql查询窗口会出现out of memory的错误。

还请牛人不吝指教。
...全文
1421 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
iihero 2014-09-03
  • 打赏
  • 举报
回复
加大share buffer时,超过1G,就会无法启动postgresql? 你的pg跑在哪个操作系统下边? 物理配置 是多少?
  • 打赏
  • 举报
回复
From the log you posted, I can't tell there was a OOM or stack overflow. server process (PID 11452) was terminated by exception 0xC0000005 Is your PG on a Windows machine ( "ntstatus.h")? 0xC0000005 is segmentation fault. There was a memory access violation. What are the version number of ur PG and PostGIS? if you were mainly doing insert, shared_buffer may not help too much since it's for caching data. shared_buffer along with other param, such as work_mem, however, could impact other db operations. Since you were doing spatial queries, the implementation of Postgis should be examined as well. Why PG can't do buffer over 1GB, I have no idea. How much ram do you have on that machine? Speak of speeding up insert, there are just too many factors that could potentially affect the performance of insertion remove index, drop FK, prefer copy over insert, use transaction to delay fsync. Of course, it's also related to hardware, such as iops, amount of ram, One more thing: don't run postgresql against windows...
内容概要:本文介绍了如何利用 GitHub Copilot 辅助进行程序调试与 Bug 分析,强调 Copilot 不仅可用于代码生成,更是强大的代码分析与调试工具。文章详细阐述了 Copilot 在调试复杂问题、老旧项目维护和难以复现 Bug 场景下的优势,提出了“先分析、再修改”的四步流程:分析原因→评估风险→提出方案→修改代码,并推荐结合错误日志、用户操作等信息精准提问,提升 AI 回答质量。同时展示了如何通过 Copilot 增强调试能力,如自动加日志、异常保护、生成测试数据和性能分析。最后通过游戏拾取系统的实际案例,说明如何结构化描述问题以获得有效反馈。; 适合人群:具备一定开发经验,正在参与项目调试或维护工作的程序员,尤其是面对复杂逻辑、历史代码或难复现 Bug 的 1-3 年开发者;也适合希望提升 AI 协作能力的技术人员。; 使用场景及目标:①快速定位偶发性崩溃、数据异常等问题根源;②理解无文档或结构混乱的老代码模块;③优化调试流程,借助 AI 生成诊断建议、修复方案与测试用例;④构建更具健壮性的程序,提前发现潜在缺陷。; 阅读建议:学习者应结合自身项目中的真实问题,按照文中提供的结构化提问模板实践,逐步训练与 Copilot 的协作能力,重视问题描述的完整性与准确性,避免直接要求修改代码,优先通过分析提升对系统的理解。
内容概要:本文针对高精度电流控制下的永磁同步电机(PMSM)参数辨识难题,提出一种基于粒子群优化算法(PSO)的多参数辨识模型,并在Simulink环境中完成系统级仿真实现。研究旨在克服传统控制中因电机参数(如定子电阻、交直轴电感、永磁磁链等)随温度、负载变化而失配所导致的电流控制性能下降问题。通过构建以电流跟踪误差为核心的适应度函数,利用PSO算法全局寻优能力强的特点,实现对关键电机参数的在线或离线精确辨识。文中详述了PSO算法的实现机制、参数初始化策略、收敛判据设计以及与PMSM矢量控制系统的集成方法,验证了该方案在不同运行工况下的辨识精度、收敛速度与鲁棒性,显著提升了电流环的动态响应品质与稳态控制精度。; 适合人群:具备电机驱动控制、现代控制理论及优化算法基础,熟悉MATLAB/Simulink仿真平台,从事高性能PMSM控制系统研发的研究生、高校科研人员及自动化、电力电子领域的工程师;特别适合正在开展参数自适应、智能控制算法应用等相关课题的研究者。; 使用场景及目标:①应用于高端制造装备、电动汽车驱动系统、精密伺服系统等对电流控制精度要求严苛的场合;②解决实际工程中因电机温升、老化等因素引发的参数漂移问题,提升系统长期运行稳定性;③作为智能优化算法与电机控制深度融合的教学案例,帮助理解PSO在复杂非线性系统参数辨识中的应用逻辑与实现路径。; 阅读建议:建议读者结合提供的Simulink仿真模型进行复现实验,重点剖析PSO算法模块与电机控制模型的接口设计、适应度函数的构建原则及参数敏感性分析方法,可进一步尝试引入其他先进优化算法(如GWO、HHO)进行性能对比,以深入掌握不同智能算法在工程辨识问题中的适用性与优劣。

975

社区成员

发帖
与我相关
我的任务
社区描述
PostgreSQL相关内容讨论
sql数据库数据库架构 技术论坛(原bbs)
社区管理员
  • PostgreSQL社区
  • yang_z_1
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧