Skip to content

Fix PhysX wasm memory leak and update PhysX to 4.1.2.29882248 to memory overflow issues.#18420

Merged
dumganhar merged 11 commits intococos:v3.8.6from
dumganhar:386-fix-physx-wasm-memory-leak
Mar 9, 2025
Merged

Fix PhysX wasm memory leak and update PhysX to 4.1.2.29882248 to memory overflow issues.#18420
dumganhar merged 11 commits intococos:v3.8.6from
dumganhar:386-fix-physx-wasm-memory-leak

Conversation

@dumganhar
Copy link
Contributor

Re: #

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

@github-actions
Copy link

github-actions bot commented Mar 7, 2025

Code Size Check Report

Wechat (WASM) Before After Diff
2D Empty (legacy pipeline) 1001919 bytes 1001919 bytes ✅ 0 bytes
2D All (legacy pipeline) 2409295 bytes 2409507 bytes ⚠️ +212 bytes
2D All (new pipeline) 2496524 bytes 2496736 bytes ⚠️ +212 bytes
(2D + 3D) All 5413059 bytes 5412828 bytes 👍 -231 bytes
Web (WASM + ASMJS) Before After Diff
(2D + 3D) All 16920733 bytes 16915180 bytes 👍 -5553 bytes

Interface Check Report

This pull request does not change any public interfaces !

@dumganhar dumganhar marked this pull request as draft March 8, 2025 03:05
@dumganhar dumganhar marked this pull request as ready for review March 8, 2025 14:33
export function getContactDataOrByteOffset (index: number, offset: number): any {
const gc = PX.getGContacts();
const data = gc.get(index + offset);
gc.delete();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getGContacts returns pointer now, so .delete() is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if(USE_PHYSICS_PHYSX)
if (ANDROID AND CMAKE_ANDROID_ARCH_ABI MATCHES x86)
set(USE_PHYSICS_PHYSX OFF)
message(AUTHOR_WARNING "Native PhysX does not support Google Android X86")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support android x86 for physx now.

cd $GITHUB_WORKSPACE/templates/android/build
mkdir -p build-android/proj
touch build-android/proj/cfg.cmake
echo "set(USE_PHYSICS_PHYSX ON)" >> build-android/proj/cfg.cmake
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI should also build physx c++ backend.

@dumganhar
Copy link
Contributor Author

@cocos-robot run test cases

@dumganhar dumganhar merged commit 9d51fe2 into cocos:v3.8.6 Mar 9, 2025
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant