我有一个多线程管道程序,它有一个管道的单个元素,需要花费几个小时来计算长数据。
它适用于相对少量的数据,但对于大数据,它在6小时后崩溃。我收到了这个错误:
# A fatal error has been detected by the Java Runtime Environment:
#
# Internal Error (safepoint.cpp:310), pid=47713, tid=11267
# guarantee(PageArmed == 0) failed: invariant
#
# JRE version: Java(TM) SE Runtime Environment (8.0_65-b17) (build 1.8.0_65-b17)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.65-b01 mixed mode bsd-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# DIR/hs_err_pid47713.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Abort trap: 6
DOMAIN$ unlimit -c unlimited
-bash: unlimit: command not found
似乎没有办法在mac上执行此操作。我的程序崩溃的任何想法,
答案 0 :(得分:0)
如果您搜索Google,这些类型的CREATE PROCEDURE Merge_Tables
(
@tablenameTarget VARCHAR(128),
@tablenameSource VARCHAR(128)
)
AS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SET NOCOUNT ON
--variables
DECLARE @targetPK VARCHAR(128),
@sourcePK VARCHAR(128),
@columns VARCHAR(MAX),
@sql VARCHAR(8000)
--temp table for the primary keys
CREATE TABLE #tableMapping
(
TargetPK VARCHAR(128),
SourcePK VARCHAR(128),
Columns VARCHAR(MAX)
)
--temp table for the comma delimted columns
CREATE TABLE #Columns
(
ColumnsUpdate VARCHAR(MAX)
)
--get the primary keys for both target and source tables. so we make sure we dont update or insert them
INSERT INTO #tableMapping
SELECT cu.COLUMN_NAME,
sourcePK.COLUMN_NAME,
data.columns
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS ta
INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE cu
ON cu.Constraint_name = ta.CONSTRAINT_NAME
OUTER APPLY
(
SELECT cus.COLUMN_NAME
FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tas
INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE cus
ON cus.Constraint_name = ta.CONSTRAINT_NAME
WHERE tas.Table_Name = @tablenameSource
AND ta.CONSTRAINT_TYPE = 'Primary Key'
) AS sourcePK
OUTER APPLY
(
SELECT STUFF(
(
SELECT ',' + Column_Name
FROM INFORMATION_SCHEMA.Columns Columns
WHERE ta.Table_Name = Columns.Table_Name
AND Columns.Column_Name <> cu.COLUMN_NAME --dont get the primary key
ORDER BY Column_Name
FOR XML PATH ('')
), 1, 1, '') columns
) AS data
WHERE ta.Table_Name = @tablenameTarget
AND ta.CONSTRAINT_TYPE = 'Primary Key'
--populate the variables so we can use it in our dynamic merge statement
SELECT @targetPK = TargetPK,
@sourcePK = SourcePK,
@columns = Columns
FROM #tableMapping
--make sure the rows match from the source and target tables, and make it in a comma delimted string
INSERT INTO #Columns
SELECT
STUFF(
(
SELECT ',' + 'TRGT.' + Column_Name + ' = SRCE.' + COLUMN_NAME
FROM INFORMATION_SCHEMA.Columns Columns
WHERE t.Table_Name = Columns.Table_Name
AND Column_Name <> @targetPK
ORDER BY Column_Name
FOR XML PATH ('')
), 1, 1, ''
)Columns
FROM INFORMATION_SCHEMA.Columns t
INNER JOIN INFORMATION_SCHEMA.TABLE_CONSTRAINTS ta
ON ta.TABLE_NAME = t.TABLE_NAME
INNER JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu
ON ccu.Constraint_name = ta.CONSTRAINT_NAME
WHERE t.Table_Name = '' + @tablenameTarget + ''
INTERSECT
SELECT
STUFF(
(
SELECT ',' + 'TRGT.' + Column_Name + ' = SRCE.' + COLUMN_NAME
FROM INFORMATION_SCHEMA.Columns Columns
WHERE t.Table_Name = Columns.Table_Name
AND Column_Name <> @sourcePK
ORDER BY Column_Name
FOR XML PATH ('')
), 1, 1, ''
)Columns
FROM INFORMATION_SCHEMA.Columns t
WHERE t.Table_Name = '' + @tablenameSource + ''
--use dynamic sql for our merge statement
SET @sql = 'MERGE ' + @tablenameTarget + ' AS TRGT
USING ' + @tablenameSource + ' AS SRCE
ON SRCE.' + @sourcePK + ' = TRGT.' + @targetPK + '
WHEN MATCHED THEN UPDATE SET ' + (SELECT ColumnsUpdate FROM #Columns)+ '
WHEN NOT MATCHED BY TARGET THEN
INSERT (' + (SELECT @Columns)+ ')
VALUES (' + (SELECT 'SRCE.' + REPLACE(@columns, ',',',SRCE.')) + ')
WHEN NOT MATCHED BY SOURCE THEN
DELETE;'
EXEC (@sql)
DROP TABLE #Columns
DROP TABLE #tableMapping
JVM崩溃已经在Oracle JDK版本6,7和8中出现。
您可以尝试解决此问题的几个“简单”事项:
1)更改您正在运行的JRE的版本,例如尝试升级到比guarantee(PageArmed == 0) failed: invariant
;
2)升级您的操作系统,例如你在运行旧版Linux吗?
3)你提到了大量的数据。您是否考虑过使用像YourKit这样的分析器来研究JVM中的线程和堆内存使用情况,以便将它们排除为问题?
答案 1 :(得分:0)
这是一个JVM编译器问题, 内部错误(safepoint.cpp:310),pid = 47713,tid = 11267
建议其中一个线程无法达到安全点。 当一个安全点挂起时,VMThread将一直等到_thread_in_Java的所有线程都转换到另一个状态,在这个状态下,它们已经是安全点[_thread_blocked,_thread_in_native],或者它们将与VMThread进行握手以保证安全(_thread_in_VM) 最可能的原因是无法安装的编译器循环,其中没有生成安全点轮询 您应该向http://bugreport.java.com/报告以及测试用例以重现此问题。