Too many heap sections как исправить

Сборщик мусора Boehm GC ++: слишком много разделов кучи Увеличьте MAXHINCR или MAX_HEAP_SECTS

Я использую сборщик мусора Boehm C ++ в приложении. Приложение использует программу Python для детерминированных конечных автоматов Левенштейна для вычисления расстояния Левенштейна между двумя строками. Я перенес программу Python на C ++ в версии Centos Linux с помощью gcc 4.1.2.

Недавно я заметил, что после запуска приложения более 10 минут я получаю сообщение об ошибке SIGABRT: Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS . Мне было интересно, знает ли кто-нибудь, как исправить или обойти эту проблему.

Вот моя трассировка стека GDB. Спасибо.

Обновление:

Я просмотрел исходный код и файлы заголовков сборщика мусора Boehm и понял, что: Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS сообщение об ошибке можно исправить, добавив ‑DLARGE_CONFIG в раздел CFLAGS в моем файле GNUmakefile.

Я протестировал это изменение в своем файле GNUmakfile и обнаружил, что Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS сообщение об ошибке больше не возникает. Однако я получаю новую ошибку сегментации (дамп ядра). Используя gdb, я обнаружил, что ошибка сегментации GDB произошла в следующей функции в строке 20 (которую я аннотировал):

Мне было интересно, можно ли изменить эту функцию, чтобы исправить ошибку сегментации. Спасибо.

Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS when allocating many sets #5610

Hello, I’m hitting an internal limit described in the error message below:

Here’s a simple example that crashes and gets this error message way before it runs out of memory. I ran this on an EC2 instance with 122GB of RAM, the loop got to 17690000 before crashing, and only used 8.6GB of RAM at its peak.

My use case is more complex than this (basically doing a GROUP BY and SUM on large 100MB CSVs), but this error is blocking this task. I’m not sure how to interpret Increase MAXHINCR or MAX_HEAP_SECTS — is there a suggested way to increase this limit?

The text was updated successfully, but these errors were encountered:

RX14 commented Jan 19, 2018

No, don’t try the immix gc. Its pre alpha and it will be broken. That’s terrible advice.

RX14 commented Jan 19, 2018

The problem is in how libgc is configured, it can only handle heaps of 8gb or less. It needs to be recompiled for large heaps using specific configure options. I’ll work out a process for this and include it in the omnibus and provide a download hopefully later today.

asterite commented Jan 19, 2018

It seems you can set GC_MAXIMUM_HEAP_SIZE=. to the size you want.

I would recommend first trying to find out why you are allocating so much memory, and optimizing that. If you could post the real code you are working on we could help you optimize it.

RX14 commented Jan 19, 2018

@asterite some people genuinely need to use 120gb of ram for their datasets. We should support that usecase.

asterite commented Jan 19, 2018

I mean, the CSV is 100MB, you shouldn’t require 120GB to process it.

joeyrobert commented Jan 19, 2018

My simplified code shows the issue more concretely. Abstracting away some of the business-specific logic, my code to do a group by/sum is below.

This should keep only one of the same group in memory at one time, so it builds the sum for the group online. I’m replacing a Python script that does that same thing using a less efficient algorithm that requires much more data stored in memory. Python doesn’t choke on using 120GB+ memory, but I’m rewriting so we can run this on smaller EC2 instances.

The dataset is like:

=> which should output one summarized CSV of all of them. So really this algorithm shouldn’t need 120GB, but the internal representation could be greater than 8GB.

asterite commented Jan 19, 2018

Yeah, there doesn’t seem to be a way around that. I guess the number of different groups is probably huge so you basically have to have a lot of data in memory.

Tweaking the GC is probably good here. If there’s an option to disable that warning/crash, �� from me.

NIFR91 commented Mar 14, 2018

I have the same problem of allocating more than 8 GB.

Is Crystal going to support bigger heap allocation by default?

I could run the program when setting GC_INITIAL_HEAP_SIZE=

straight-shoota commented Mar 14, 2018

GC_INITIAL_HEAP_SIZE probably also adjusts the maximum size accordingly, but what’s really needed here is GC_MAXIMUM_HEAP_SIZE . Of course in your case it might make sense to set the initial heap size to a large value.

I’m not sure if crystal should have a larger max or initial size by default. What would that even be? 8GB seems reasonable for most use cases. When you need more, it’s just a simple environment setting.

joeyrobert commented Mar 18, 2018 •

Is there a performance advantage for keeping GC_MAXIMUM_HEAP_SIZE low? I’m wondering why it can’t be made arbitrarily large. Also is this environment variable meant to be used at compile time or runtime? And what is the format/units of the variable? I’ve been trying to test it with export GC_INITIAL_HEAP_SIZE=30G this morning and still running into the Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS error after

I’ve tried and errorred with:

I may be the exception, a lot of my use cases involves paging big datasets from memory.

bararchy commented Mar 18, 2018

@joeyrobert you’re not the Exception, this is a known and talked about issue, we also do lots of Big Data stuff and we managed to subvert it using the export max heap option

straight-shoota commented Mar 18, 2018 •

Not necessarily a performance issue. But most typical use cases wont need an unlimited (or very large) heap size. Your’re certainly not an exception but a small minority.

I guess one of the reasons to limit the size by default is, if an application has a memory leak but huge amounts of memory available, the issue will probably not be noticed for a while.

So, IMO it is fine to have a default value limited to a heap size that totally fits 90% of applications and an easy way to change it if you have a higher demand.

Too many heap sections как исправить

Today, after getting like 20+ times the error "Too many heap sections", I began to be very frustrated with the fact that my game crashes every 5-10 minutes, so I tried to find why this error always spawn on my face, and by what it is caused. I found out that the game have a 900 mb of RAM of allocated memory, and by reading plenty of review and error crashes, this 900 mb is capped very easily and very fast. So I tried to boost that 900 mb so that my game crash less and less. By a simple Steam command, you can boost the allocated memory for a game and get a more fluid game, whatever the game is.

These are the simple steps for boosting the heapsize :
1.Go on your Library, right-click on Castle Story and select "Properties"
2.Go on General tab, and click on "Set Launch Options"
3.Type "-heapsize 786432" on it

I can’t remember what 786432 means, but I know that is upgrading the allocated memory to 1.5GB of RAM

Thanks for watching, and hope it’ll do the job for you all
Lol@YourFace

Aujourd’hui, après avoir eu le bug "Too many heap sections" trop de fois, je suis devenu vraiment frustré,donc j’ai essayé de découvrir pourquoi cette erreur apparaît trop souvent, mais surtout par quoi elle est provoquée. J’ai trouvé, après maintes recherches, que ce jeu a une mémoire allouée de 900 mb, et qu’en plus cette limite est atteinte beaucoup trop vite. J’ai donc décidé de trouver un moyen d’augmenter cette limite facilement. J’ai trouvé que l’on pouvait le faire avec une commandee Steam, que l’on édite dans les optiosn de lancement du jeu.

Voici les étapes simples pour augmenter la mémoire alloué, et cela fonctionne pour n’importe quel jeu :
1.Allez dans votre Bibliothèque, faites un clic droit sur Castle Story et allez sur "Propriétés. "
2.Allez dans l’onglet "Générales" et cliquez sur "Définir les optiosn de lancement. "
3.Écrivez "-heapsize 786432" dans cet espace

Je ne me souviens pas ce que le chiffre 786432 veut dire exactement, mais je sais que cela augmente votre limite jusqu’à 1.5GB de RAM

Merci d’avoir pris le temps de me lire, et j’espère grandement de vous avoir aidé
Lol@YourFace

Fatal error как исправить в игре

Из названия статьи вы уже поняли, что именуется данная ошибка «Fatal error in gc». А суть этой ошибки: «Get Thread Context failed». Практически все пользователи, познакомившиеся с «Fatal error in gc» — игроманы, в хорошем смысле этого слова. То есть, на компьютере или ноутбуке установлен клиент какой-либо браузерной игры, какая игра – не важно. Естественно, из-за большой популярности игр:

  • «Ground War: Tanks».
  • «Metal War Online»
  • «Contract Wars»
  • «Cities: Skylines»
  • «Prime World: Defenders»

— ошибка всплывает чаще всего именно в клиентах этих игр.

Список игр можно продолжать перечислять до бесконечности. Суть всего выше сказанного такова: ошибка «Fatal error in gc» появляется во время игры, в Клиент версии игры. Изначально игры браузерные, но разработчики этих самых игр, создают Клиент игры и ошибка выскакивает именно в Клиенте игры, а не в браузерной версии.

Что означает ошибка «Fatal error in gc» и как исправить ошибку «Fatal error in gc»?

Мы решили отследить историю возникновения данной ошибки у пользователей, а точнее у игроманов.

В 2010 году о данной проблеме ещё не слышали и не видели. Тогда, в далёком десятом году, вылетала ошибка «Fatal error in gc», но, правда, с надписью: «Too many heap sections», что явно не с нашей оперы. Наша, рассматриваемая проблема, появилась ровно через десять месяцев, в конце 10-ого, начале 11-ого годов.

В 2011 году начинают появляться призывы о помощи в решении проблемы с «Fatal error in gc» в играх «Wolf Quest» и «Prime World». В те далёкие времена начали появляться всплывающие окошки от виндовс с надписью «Неисправимая ошибка» или «Фатальная ошибка».

И, начиная с 2011 года, начали регулярно всплывать мольбы о помощи на различного рода игровых форумах. Ошибка «Fatal error in gc» появилась в 2013 году в играх: «King’s Bounty: Legions» и «Contra City».

И вот уже сейчас, спустя шесть лет (с 2011 по 2017), проблема остаётся трудно решаемой. Одни советуют одно, другие советуют второе. Как же решить проблему со всплывающей «Фатальной ошибкой»?

Как решить проблему: «Fatal error in gc: Get Thread Context failed»?

Сразу отметим, что причиной возникновения этого лага не есть антивирусники. Отключать, удалять и переустанавливать антивирусник, не важно Kaspersky Anti-Virus это или Dr.Web CureIt – это не решит проблему. Но, отказываться от совета или нет, решать вам: «Необходимо отключить антивирусник, а точнее Real-time shield защиту, потом почистить кеш и перезапусть игровой Клиент». Маловероятно, что проблема у вас решиться, но исключить данный вариант решения вопроса следует

Суть проблемы «Fatal error in gc: Get Thread Context failed» — это несовместимость игры с вашей ОС. Грубовато сказано, но зато доходчиво, ведь действительно проблема в совместимости, которую можно решать несколькими путями.

Решение вопроса с совместимостью

Для решения совместимости программы (игрового клиента) следует кликнуть по иконке игры или по файлу с разрешением .exe правой кнопкой мыши.

В появившемся окошке, выбираем пункт «Исправление проблем с совместимостью».

Дальнейшие действия очень просты. В появившемся окошке, вам необходимо будет определиться с выбором варианта решения проблемы с совместимостью.

Первый пункт. В первом варианте вам будет предложено решить проблему с совместимостью с помощью рекомендованных параметров. При выборе именно этого пункта решения вопроса совместимости, всё закончится довольно таки быстро. Windows решит проблему методом присвоения параметров, которые соответствуют режиму совместимости с Windows Windows 8.

Второй пункт «Диагностика программы» — это долгий путь, который будет закончен режимом совместимости Windows Windows XP. Попробуйте оба варианта совместимости и остановитесь на том варианте, который устраняет возникновение «Fatal error in gc».

Если вы знаете, как по другому решается проблема возникновения Fatal error in gc — пишите об этом в комментариях под этой статьёй.

Little Nightmares

Если Вы столкнулся с ошибкой "Fatal error" в игре Little Nightmares, то есть решение с использованием эмулятора.

Его можно скачать по ссылке ниже.

Инструкция по запуску через эмулятор.

А что делать если данный способ не помог, есть еще варианты?
Проц AMD phenom II x4 995, после всех манипуляций, уже в меню игры жуткие фризы и загрузка камня 99%.

А что делать если данный способ не помог, есть еще варианты?
Проц AMD phenom II x4 995, после всех манипуляций, уже в меню игры жуткие фризы и загрузка камня 99%.

У меня тоже процессор AMD Phenom II x4. Модель не помню. Какая у тебя видеокарта и сколько оперативной памяти? Всё делал как в видео?

Кастыль, не играбельно. Через N-ое время наичнает безбожно тормозить.

P.S: id игры при новом запуске меняется.
P.S: AMD Phenom II X4 970, 16 GB памяти, MSI R7 265 2GB

P.S: Не мучайтесь, делайте возврат денег.

Круто конечно, что и лицензия запускается через эмулятор, но кто-нибудь в курсе собираются разработчики это поправлять?

Ведь по факту толку от того что они юзают SSE4a никакого — лучше бы оптимизировали игру и поправили местами управление — местами очень неудобно.

Мы недавно уже писали об одной из ошибок FATAL ERROR в S.T.A.L.K.E.R.: Call of Pripyat, не подумайте, что это та же самая. Дело в том, что ошибки в этой игре не отображают не код, а значатся просто как FATAL ERROR. И методы смправления у этих багов разумеется совершенно разные. Различать эти баги можно исключительно по тексту, который вы увидите в табличке с ошибкой. В нашей статье мы разберем FATAL ERROR, сопровождающуюся следующим текстом:

[error]Expression : fatal error [error]Function : CInifile::Load [error]File : D:prog_repositorysources runkxrCoreXr_ini.cpp [error]Line : 274 [error]Description : [error]Arguments : Duplicate section ‘wpn_m16’ found.

Давайте мы расскажем вам, как избавиться от этого неприятного бага.

Метод устранения ошибки

Устранить ошибку не так уж и сложно, вам всего лишь нужно:

  1. Зайти в папку с игрой.
  2. Найти в ней папку gamedata и удалить ее.
  3. Далее , если игра скачана в Steam, о найдите ее в библиотеке, щелкните правой кнопкой и выберите «Обновить кэш».
  4. Также, если вы используете моды, то рекомендуется использовать только один мод оружия.

Радостная новость заключается в том, что переустановка игры не требуется и после этих нехитрых действий ошибка должна пропасть. Приятной игры!

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *