Last active
June 9, 2024 05:00
-
-
Save ykominami/3c660113bccae28c69294b9efe3df04c to your computer and use it in GitHub Desktop.
Cygwin #memo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Cygwin † | |
| ↑ | |
| ヒープサイズ † | |
| Cygwinでコードを実行していると、頻繁にヒープ不足に陥る。 これは、デフォルトで384MBまでしかヒープを使わないようになっているため。 | |
| ↑ | |
| 1.7.10以降の場合 † | |
| 新しい Cygwin は、バイナリごとに、ヒープサイズを変えることが出来るようになった。 ヒープサイズは peflags コマンドで取得・設定出来る。 | |
| ヒープに関するオプションはいくつかあるが、Cygwinで意味を持つのは -z (--cygwin-heap)のみである。 | |
| -z, --cygwin-heap -z0x2048 | |
| -x, --stack-reverse -x0x2048 | |
| -X, --stack-commit -X0x2048 | |
| -y, --heap-reserve -y0x2048 | |
| -Y, --heap-commit -Y0x2048 | |
| araki@mango[65]% peflags -z f.exe | |
| f.exe: initial Cygwin heap size: 0 (0x0) MB | |
| araki@mango[66]% peflags -z2048 f.exe | |
| f.exe: initial Cygwin heap size: 2048 (0x800) MB | |
| araki@mango[67]% peflags -z f.exe | |
| f.exe: initial Cygwin heap size: 2048 (0x800) MB | |
| araki@mango[68]% | |
| zのあとに数字がなければ、値を取得する。デフォルトでは特に割り当てはないが、数字を指定すればそのサイズ(MB)が割り当てられる。-z のあとに空白はあけてはいけない。--cygwin-heapの場合には--cygwin-heap=2048のように指定する。 | |
| ↑ | |
| 1.7.10以前の場合 † | |
| これを拡大するには、レジストリを変更して、Cygwinを再起動する必要がある。 *6 | |
| レジストリは、HKCUの中のCygwinの関連項目にキーを追加、あるいはその値を変更するこことになる。 Windows Vista以降の場合であっても、HKCUなので自分の権限だけで操作できるので、企業ユーザでも管理者に依頼せずに自分でできるところはポイントが高い。*7 | |
| 変更するレジストリは、 | |
| HKLM/Software/Cygwin/heap_chunk_in_mb | |
| REG_DWORD か何かにして、10進数で、MB単位でヒープサイズを指定する。1024 とすれば1GBのヒープになる。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export CYGWIN=error_start=dumper |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment