CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

memory allocation issue using Field<vector>

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By CFDMi
  • 1 Post By CFDMi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 22, 2019, 04:31
Default memory allocation issue using Field<vector>
  #1
New Member
 
/
Join Date: Jan 2019
Posts: 7
Rep Power: 7
CFDMi is on a distinguished road
Hi all!

The issue concerns following declaration:

Field<vector> subCellPos(10000, vector::zero);

It does not produce an error at compile time, rather shows up at runtime at the first instance of it. The funny thing is, that sometimes the code runs fine past this line (I cannot tell if it would work for more timesteps, since I have another issue later in the code). The error given most of the time is corrupted size vs. prev_size or sometimes malloc: invalid chunk size.
I am certain that this line causes the crash, but unfortunately I am not experienced enough to fix this issue. I tried creating a smaller field with size 5 instead of 10000 and that works fine apparently, so my guess is it has something to do with stack size?

Thanks in advance for any replies!
anhkenyt likes this.
CFDMi is offline   Reply With Quote

Old   August 22, 2019, 04:43
Default
  #2
New Member
 
/
Join Date: Jan 2019
Posts: 7
Rep Power: 7
CFDMi is on a distinguished road
Probably not a stack size issue, because I get the same error when declaring it on the heap using the new keyword.
CFDMi is offline   Reply With Quote

Old   August 23, 2019, 03:23
Default
  #3
New Member
 
/
Join Date: Jan 2019
Posts: 7
Rep Power: 7
CFDMi is on a distinguished road
The error was not caused by this line of code, even though debugging with Info messages made it seem as though it was.
CFDMi is offline   Reply With Quote

Old   May 11, 2020, 02:08
Default
  #4
New Member
 
Duc Anh
Join Date: Dec 2018
Posts: 22
Rep Power: 7
anhkenyt is on a distinguished road
I am having a similar problem,
Can you give me some advice to fix it ?
Thanks,
anhkenyt is offline   Reply With Quote

Old   May 11, 2020, 02:53
Default
  #5
New Member
 
/
Join Date: Jan 2019
Posts: 7
Rep Power: 7
CFDMi is on a distinguished road
Like I said, the error in my case was somewhere else... Usually something wrong with a pointer/reference or maybe you are trying to access an out of bounds list entry (or some other reason).

With enough patience you will find it!
HPE likes this.
CFDMi is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Workbench 16.0 - Memory Allocation Factor 196235 CFX 3 August 11, 2016 02:05
memory allocation error MAB CFX 16 December 30, 2014 20:59
Run-time memory allocation error akalopsis CFX 0 November 17, 2014 17:17
Memory issue - Suse 10 - Opterons Andy R FLUENT 1 June 23, 2008 14:44
Memory allocation problem Ammar Abdilghanie FLUENT 5 February 19, 2007 18:15


All times are GMT -4. The time now is 01:51.