March 28, 2024, 16:37
bigger smaller reset     1020px Wide width Full width Reset   * *

Gildor's Forums

  Homepage Facebook Read news on Twitter Youtube channel Github page
Welcome, Guest. Please login or register.
Did you miss your activation email?

« previous next »
Print
Author Topic: Crash on export of a specific file  (Read 11369 times)
Chaoss
Newbie
*
Posts: 4


View Profile
« on: August 06, 2017, 21:03 »

Trying to export Battlegrounds' map (Link to the file: https://ufile.io/wst7r )
When trying to export the model viewer crashes with the following error:
Code:
Loading package: /TslGame/Content/UI/HUD/Erangel_Minimap.uasset Ver: 508/0 Engine: 0 [Unversioned] Names: 15 Exports: 1 Imports: 3 Game: 10000E0
Memory: allocated 754084 bytes in 5165 blocks
Loading Texture2D Erangel_Minimap from package /TslGame/Content/UI/HUD/Erangel_Minimap.uasset
Loading data for format PF_DXT1 ...
Loaded in 0.22 sec, 1035 allocs, 15.39 MBytes serialized in 511 calls.
Exporting objects ...
Exporting Texture2D Erangel_Minimap to C:/Users/Chaos/Desktop/UE4/UmodelExport/UI/HUD
******** /TslGame/Content/UI/HUD/Erangel_Minimap.uasset ********
*** ERROR: Memory: bad allocation size 268435456 bytes
appMalloc:size=268435456 (total=32 Mbytes) <- CTextureData::Decompress:fmt=PF_DXT1(5) <- ExportTexture <- ExportObject:Texture2D'Erangel_Minimap' <- ExportObjects <- CUmodelApp::ShowPackageUI <- Main:umodel_version=612
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #1 on: August 07, 2017, 00:30 »

UModel's code not allowing to allocate memory blocks larger or equal of 256Mb. This is USUALLY just not a good allocation. For your case, it allocates exactly 256Mb memory block. I've made some calculations, and it seems there's a texture 16384x16384. This texture size might be unsupported by rendering hardware, so it is also bad.

If UModel will try to save such texture in uncompressed (tga) format, it will allocate 1Gb of memory for DXT decompression (16k x 16k x 4 bytes per pixel), so allocation will fail again. Even more - UModel is 32-bit application, and any 32-bit applications usually fails to allocate memory blocks which are 1Gb of size - probably because of memory fragmentation, I don't know.

Possible solution for you.
1. download UModel's source code.
2. disable check for "bad memory block size".
3. compile it by yourself for 64-bit platform.

Or - just ignore this texture.
Logged
Chaoss
Newbie
*
Posts: 4


View Profile
« Reply #2 on: August 07, 2017, 07:44 »

Well, I need this specific texture, so I can't ignore it Smiley
I will try your solution later today and will post again! Thanks
Logged
Chaoss
Newbie
*
Posts: 4


View Profile
« Reply #3 on: August 07, 2017, 15:31 »

I disabled the upper limit, but can't compile
Code:
void *appMalloc(int size, int alignment)
{
guard(appMalloc);
if (size < 0/* || size >= (256<<20)*/) // upper limit for single allocation is 256Mb
appError("Memory: bad allocation size %d bytes", size);

Code:
./../Libs/msvcrt/startup/crtexe2.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

EDIT:
I tried compiling as x86 and it was able to export my texture  Grin Grin Grin Grin
« Last Edit: August 07, 2017, 17:15 by Chaoss » Logged
Chaoss
Newbie
*
Posts: 4


View Profile
« Reply #4 on: August 07, 2017, 17:22 »

New question tho, if the texture is 16384 why does it export a 8192 tga?
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #5 on: August 07, 2017, 22:48 »

I don't know if texture should be 16k - it was just my assumption.
Logged
CoolBoy66
Newbie
*
Posts: 1


View Profile
« Reply #6 on: December 20, 2021, 02:42 »

Hi, how to disable upper limit? And where in the source code??
Logged
gamerbross
Newbie
*
Posts: 1


View Profile
« Reply #7 on: January 12, 2022, 18:41 »

https://github.com/gildor2/UEViewer
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #8 on: January 12, 2022, 18:44 »

https://github.com/gildor2/UEViewer/discussions/250
Logged
formattedfool
Newbie
*
Posts: 1


View Profile
« Reply #9 on: September 17, 2022, 22:28 »

I know this is a little old but, I had this issue when trying to open files for AA2. Each time I would select the root folder, and try to open a file, it would crash with the " ERROR: Memory: bad allocation size xx bytes ".  I moved the folder, containing the .usx files I was trying to open, to the desktop and gave the folder a short name(sMesh). It opened every file without issue. I relayed my information to a friend, who was also having the same issue. Same result as I had. I hope this helps anyone else experiencing this error.
Logged
Print 
« previous next »
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS