You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. What did you do? If possible, provide a simple script for reproducing the error.
I've set the Table conflictProportion from the default 1 to 0.2, to reduce memory usage
use OpenSwoole\Table;
$table = new Table(1024, 0.2); // before was => $table = new Table(1024);
$table->column('id', Table::TYPE_INT, 8);
$table->column('name', Table::TYPE_STRING, 64);
$table->column('age', Table::TYPE_INT, 2);
$table->column('money', Table::TYPE_FLOAT);
$table->create();
echo "memory: " . $table->getMemorySize() . "\n";
2. What did you expect to see?
A memory usage reduction
3. What did you see instead?
Without the conflictProportion param: 401456 bytes
With the conflictProportion param set to 0.2: 401456 bytes
I think the problem is that when setting a value that is lower than 1, it's resetted here due to the SW_TABLE_CONFLICT_PROPORTION set to 1.
This make the parameter useless/ignored.
What version of OpenSwoole are you using (show your php --ri openswoole)?
bash-5.1# php --ri openswoole
openswoole
Open Swoole => enabled
Author => Open Swoole Group <[email protected]>
Version => 22.1.2
Built => Dec 10 2023 21:17:14
coroutine => enabled with boost asm context
epoll => enabled
eventfd => enabled
signalfd => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 1.1.1w 11 Sep 2023
dtls => enabled
http2 => enabled
hook-curl => enabled
pcre => enabled
zlib => 1.2.12
brotli => E16777225/D16777225
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
mysqlnd => enabled
postgresql => enabled
Directive => Local Value => Master Value
openswoole.enable_coroutine => On => On
openswoole.enable_preemptive_scheduler => Off => Off
openswoole.display_errors => On => On
openswoole.unixsock_buffer_size => 8388608 => 8388608
What is your machine environment used (show your uname -a & php -v & gcc -v) ?
bash-5.1# uname -a
Linux 404a64ea28ca 5.15.0-117-generic #127-Ubuntu SMP Fri Jul 5 20:13:28 UTC 2024 x86_64 Linux
bash-5.1# php -v
PHP 8.1.11 (cli) (built: Oct 6 2022 23:49:21) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.11, Copyright (c) Zend Technologies
1. What did you do? If possible, provide a simple script for reproducing the error.
I've set the Table conflictProportion from the default 1 to 0.2, to reduce memory usage
2. What did you expect to see?
A memory usage reduction
3. What did you see instead?
Without the conflictProportion param: 401456 bytes
With the conflictProportion param set to 0.2: 401456 bytes
I think the problem is that when setting a value that is lower than 1, it's resetted here due to the SW_TABLE_CONFLICT_PROPORTION set to 1.
This make the parameter useless/ignored.
php --ri openswoole
)?uname -a
&php -v
&gcc -v
) ?The text was updated successfully, but these errors were encountered: