Revisiting stack sizes for New process

classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Revisiting stack sizes for New process

KirkBrooks
Hi folks,

This is a well trodden topic made muddy, if you will, by the tears of
countless devs but what is the current thinking (v15+) about the
appropriate value to set for stack size when calling New process?

I've been looking through the last few years posts on the subject and find
I'm really no closer to a firm understanding. A long time ago Josh posted
an off-hand remark about always using 1024*1024. I've been doing that with
no problems but it seems this may be drastic overkill for many things.
After doing some testing I get the concept that this stack allocation IS
NOT the total memory available to the stack (creating huge arrays in memory
doesn't use up stack, for instance). And there's the question of how much
more is required when running on 64bit vs 32bit (and how to detect that).
So it seems like a good time to ask.

--
Kirk Brooks
San Francisco, CA
=======================
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

Jeffrey Kain
The answer is 0.

No, really... :)   Check the docs.  It was news to me too.

> On Apr 19, 2016, at 2:35 PM, Kirk Brooks <[hidden email]> wrote:
>
> Hi folks,
>
> This is a well trodden topic made muddy, if you will, by the tears of
> countless devs but what is the current thinking (v15+) about the
> appropriate value to set for stack size when calling New process?

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: Revisiting stack sizes for New process

Dennis, Neil-2
In reply to this post by KirkBrooks
> This is a well trodden topic made muddy, if you will, by the tears of countless devs
> but what is the current thinking (v15+) about the appropriate value to set for stack
> size when calling New process?

Unless you have a reason to change it make it zero as recommended by 4D.


Neil






--

Privacy Disclaimer: This message contains confidential information and is intended only for the named addressee. If you are not the named addressee you should not disseminate, distribute or copy this email. Please delete this email from your system and notify the sender immediately by replying to this email.  If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

The Alternative Investments division of UMB Fund Services provides a full range of services to hedge funds, funds of funds and private equity funds.  Any tax advice in this communication is not intended to be used, and cannot be used, by a client or any other person or entity for the purpose of (a) avoiding penalties that may be imposed on any taxpayer or (b) promoting, marketing, or recommending to another party any matter addressed herein.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

spiffyguy
In reply to this post by KirkBrooks
Not sure what happens behind the scenes but in the docs it says to pass 0 in the value and it will automatically calculate based on 32bit or 64bit.

I use 0 for all my processes and never notice any problems.  But as I said I am not sure what algorithm it uses in the backend and not sure what the final number 4D figures out on it's own or why you would want to use your own number there instead of the automatic generated stack size.

- Matt
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

Richard Wright-2
In reply to this post by KirkBrooks
That’s the first I’ve heard of that. It first appears in the v15 Language Reference but I can’t find anything in the upgrade manual about it.


> Date: Tue, 19 Apr 2016 14:46:06 -0400
> From: Jeffrey Kain <[hidden email]>
>
> The answer is 0.
>
> No, really... :)   Check the docs.  It was news to me too.
>
>> On Apr 19, 2016, at 2:35 PM, Kirk Brooks <[hidden email]> wrote:
>>
>> Hi folks,
>>
>> This is a well trodden topic made muddy, if you will, by the tears of
>> countless devs but what is the current thinking (v15+) about the
>> appropriate value to set for stack size when calling New process?
>

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

spiffyguy
Richard Wright-2 wrote
That’s the first I’ve heard of that. It first appears in the v15 Language Reference but I can’t find anything in the upgrade manual about it.
I think it came live in v11 actually.  It's also in the v12 docs for "New Process"

http://doc.4d.com/4Dv12/4D/12.4/New-process.301-977762.en.html

- Matt
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

Jeffrey Kain
I know for sure that in v11 and v12 days the recommendation from 4D was to double or triple your stack sizes from the documented values, especially if you were going to run in a 64-bit environment (4D Server on Windows).

I suspect the older documentation has been revised along the way.

Jeff

> On Apr 19, 2016, at 4:25 PM, spiffyguy <[hidden email]> wrote:
>
> Richard Wright-2 wrote
>> That’s the first I’ve heard of that. It first appears in the v15 Language
>> Reference but I can’t find anything in the upgrade manual about it.
>
> I think it came live in v11 actually.  It's also in the v12 docs for "New
> Process"

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

David Adams-4
Okay, I learned two handy things today, this bit about New process/Execute
on server taking 0 and a feature called 'User settings':

http://doc.4d.com/4Dv13/4D/13.4/Using-user-settings.300-1226542.en.html

Who knew? I've been wanting that feature for as long as I had it...and I'm
not alone, there was just a thread on the Forums in France about setting
various attributes locally and not crushing them with an update. I've got a
bunch of fancy code to (try and) do some of that...but it turns out there's
a built-in feature starting with V13 (what I linked to.) 4D also seems to
have something called a "design manual" documenting a variety of features
;-)
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

Bertrand Soubeyrand
In reply to this post by Jeffrey Kain

> Le 19 avr. 2016 à 22:34, Jeffrey Kain <[hidden email]> a écrit :
>
> I know for sure that in v11 and v12 days the recommendation from 4D was to double or triple your stack sizes from the documented values, especially if you were going to run in a 64-bit environment (4D Server on Windows).
>
> I suspect the older documentation has been revised along the way.

The « feature » appears for the first time in the documentation blog and says it is available starting from v12.

http://www.4d.com/fr/company/blogs/Documentation%20Blog

The link that leads to the post seems to be broken


Bertrand SOUBEYRAND
---
La Soub Compagnie
33 bd de la Liberté - 13001 Marseille
Bureau : +33 4 84 25 21 99
http://www.soubeyrand-4d-developer.eu <http://www.soubeyrand-4d-developer.eu/>

Belgique : +32 87 84 00 88




**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

Bertrand Soubeyrand

> Le 19 avr. 2016 à 23:50, Bertrand SOUBEYRAND <[hidden email]> a écrit :
>
> The « feature » appears for the first time in the documentation blog and says it is available starting from v12.
>
> http://www.4d.com/fr/company/blogs/Documentation%20Blog <http://www.4d.com/fr/company/blogs/Documentation%20Blog>
>
> The link that leads to the post seems to be broken


found a valid link : http://www.4d.com/documentation-update-release-note-2.html


Bertrand SOUBEYRAND
---
La Soub Compagnie
33 bd de la Liberté - 13001 Marseille
Bureau : +33 4 84 25 21 99
http://www.soubeyrand-4d-developer.eu <http://www.soubeyrand-4d-developer.eu/>

Belgique : +32 87 84 00 88




**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

Sujit Shah
In reply to this post by David Adams-4
On Wed, Apr 20, 2016 at 7:37 AM, David Adams <[hidden email]> wrote:

> Okay, I learned two handy things today, this bit about New process/Execute
> on server taking 0 and a feature called 'User settings':
>
> http://doc.4d.com/4Dv13/4D/13.4/Using-user-settings.300-1226542.en.html
>
> Who knew?



I am not sure it saves all the user settings though.


--

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"There must be ingenuity as well as intention, strategy as well as
strength. "
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

David Adams-4
> I am not sure it saves all the user settings though.

The docs say which pages of settings are respected but don't go into any
additional detail. (Perhaps none are needed.) Are you aware of any errors
in the docs?
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

Sujit Shah
David,

I tried to store the security details once (IP Filtering) and believe they
were not saved. I would like to systematically go through each setting and
see which ones are saved.

Also once you do that the menu gets split into "User Settings" and
"Database Settings"



On Wed, Apr 20, 2016 at 10:41 AM, David Adams <[hidden email]> wrote:

> > I am not sure it saves all the user settings though.
>
> The docs say which pages of settings are respected but don't go into any
> additional detail. (Perhaps none are needed.) Are you aware of any errors
> in the docs?
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************
>



--

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"There must be ingenuity as well as intention, strategy as well as
strength. "
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

KirkBrooks
In reply to this post by David Adams-4
On Tue, Apr 19, 2016 at 2:37 PM, David Adams <[hidden email]> wrote:

> Okay, I learned two handy things today, this bit about New process/Execute
> on server taking 0 and a feature called 'User settings':
>
> http://doc.4d.com/4Dv13/4D/13.4/Using-user-settings.300-1226542.en.html
>

Huh! Would you look at that. The Design Reference.

​And generally, not just to David, I did see the section in the docs about
using 0 for the stack size to be set by 4D - it's just another one of those
things that seems to go against the way I've been doing things for so long
it seemed like it just couldn't be true.

--
Kirk Brooks
San Francisco, CA
=======================
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

David Adams-4
In reply to this post by Sujit Shah
On Wed, Apr 20, 2016 at 10:55 AM, Sujit Shah <[hidden email]> wrote:

> David,
>
> I tried to store the security details once (IP Filtering) and believe they
> were not saved.


Thanks for the heads up, I'll verify before deploying. What I need most
often are the 4D Backup settings to be respected locally. Right now, I suck
them into the data file when shutting down and then spit them out again
when the program starts up...or something along those lines.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

Sujit Shah
Backup settings are saved. I backup to dropbox folders and dropbox does the
rest.

On Wed, Apr 20, 2016 at 2:16 PM, David Adams <[hidden email]> wrote:

> On Wed, Apr 20, 2016 at 10:55 AM, Sujit Shah <[hidden email]> wrote:
>
> > David,
> >
> > I tried to store the security details once (IP Filtering) and believe
> they
> > were not saved.
>
>
> Thanks for the heads up, I'll verify before deploying. What I need most
> often are the 4D Backup settings to be respected locally. Right now, I suck
> them into the data file when shutting down and then spit them out again
> when the program starts up...or something along those lines.
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************
>



--

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"There must be ingenuity as well as intention, strategy as well as
strength. "
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

Richard Wright-2
In reply to this post by KirkBrooks
Hmmmm. It’s not in the PDFs that I have. From the v12.4 manual:

> In stack, you pass the amount of memory allocated for the stack of the process. It is the space in memory used to “pile up” method calls, local variables, parameters in subroutines, and stacked records. It is expressed in bytes; it is recommended to pass at least 64K (around 64,000 bytes), but you can pass more if the process can perform large chain calls (subroutines calling subroutines in cascade). For example, you can pass 200K (around 200000 bytes), if necesary.


> Date: Tue, 19 Apr 2016 13:25:44 -0700 (MST)
> From: spiffyguy <[hidden email]>
>
> Richard Wright-2 wrote
>> That’s the first I’ve heard of that. It first appears in the v15 Language
>> Reference but I can’t find anything in the upgrade manual about it.
>
> I think it came live in v11 actually.  It's also in the v12 docs for "New
> Process"
>
> http://doc.4d.com/4Dv12/4D/12.4/New-process.301-977762.en.html
>
> - Matt

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

Richard Wright-2
In reply to this post by KirkBrooks
Revision of history? Perhaps it’s been available from the very beginning. That would be around 1984, I think.



> Date: Tue, 19 Apr 2016 23:50:03 +0200
> From: Bertrand SOUBEYRAND <[hidden email]>
>
>
>> Le 19 avr. 2016 à 22:34, Jeffrey Kain <[hidden email]> a écrit :
>>
>> I know for sure that in v11 and v12 days the recommendation from 4D was to double or triple your stack sizes from the documented values, especially if you were going to run in a 64-bit environment (4D Server on Windows).
>>
>> I suspect the older documentation has been revised along the way.
>
> The « feature » appears for the first time in the documentation blog and says it is available starting from v12.
>
> http://www.4d.com/fr/company/blogs/Documentation%20Blog
>
> The link that leads to the post seems to be broken

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

Bill Weale
In reply to this post by Jeffrey Kain

William W. Weale

Business Owners Support, LLC.

Operations Analysis
MIS Advising
Decision Support Systems

> On Apr 19, 2016, at 4:34 PM, Jeffrey Kain <[hidden email]> wrote:
>
> I know for sure that in v11 and v12 days the recommendation from 4D was to double or triple your stack sizes from the documented values, especially if you were going to run in a 64-bit environment (4D Server on Windows).

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Revisiting stack sizes for New process

Bill Weale
In reply to this post by Jeffrey Kain
Just an fyi…

The debug log formats include a layering or nesting metric, “depth of the calling stack.” I think this is a good check point which could indicate a need for non-standard stack memory allocation. Or a change in coding.

Bill


William W. Weale

Business Owners Support, LLC.

Operations Analysis
MIS Advising
Decision Support Systems

> On Apr 19, 2016, at 4:34 PM, Jeffrey Kain <[hidden email]> wrote:
>
> I know for sure that in v11 and v12 days the recommendation from 4D was to double or triple your stack sizes from the documented values, especially if you were going to run in a 64-bit environment (4D Server on Windows).

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
12