ansys / pymapdl

Pythonic interface to MAPDL
https://mapdl.docs.pyansys.com
MIT License
424 stars 120 forks source link

Memory consumption when testing #2704

Open germa89 opened 8 months ago

germa89 commented 8 months ago

Using #2701 I saw that some tests seem to use a lot of memory, up to 240MB.

I do not think this is normal....

Details

```text tests/test_plotting.py::test_plots_no_vtk - 240.7 MB tests/test_grpc.py::test_large_output - 156.0 MB tests/test_launcher.py::test_version - 143.5 MB tests/test_mapdl.py::test_apdl_logging_start - 133.9 MB tests/test_plotting.py::test_pick_node_special_cases - 133.0 MB tests/test_examples.py::test_detach_examples_submodule - 95.7 MB tests/test_convert.py::test_converter_cli - 93.4 MB tests/test_plotting.py::test_eplot_savefig - 83.1 MB tests/test_misc.py::test_plain_report - 77.5 MB tests/test_plotting.py::test_pick_areas[S] - 65.9 MB tests/test_plotting.py::test_pick_node_select_unselect_with_mouse - 64.8 MB tests/test_plotting.py::test_pick_kp[S] - 64.7 MB tests/test_plotting.py::test_pick_areas[A] - 64.7 MB tests/test_plotting.py::test_pick_kp[U] - 64.7 MB tests/test_plotting.py::test_pick_nodes[A] - 64.6 MB tests/test_plotting.py::test_pick_nodes[U] - 62.9 MB tests/test_plotting.py::test_pick_areas[R] - 61.9 MB tests/test_plotting.py::test_plotter_input - 61.9 MB tests/test_plotting.py::test_pick_kp[A] - 60.4 MB tests/test_plotting.py::test_pick_areas[U] - 59.9 MB tests/test_plotting.py::test_pick_kp[R] - 58.9 MB tests/test_plotting.py::test_pick_nodes[R] - 58.2 MB tests/test_examples.py::test_download_manifold_example_data - 52.9 MB tests/test_mapdl.py::test_use_vtk - 48.9 MB tests/test_commands.py::test_cmd_class_dlist_vm - 44.5 MB tests/test_mapdl.py::test_components_selection_keep_between_plots - 42.1 MB tests/test_plotting.py::test_show_bounds - 41.4 MB tests/test_plotting.py::test_bc_plot_options[True-True-True] - 31.8 MB tests/test_grpc.py::test_cmatrix - 30.6 MB tests/test_post.py::test_cuadratic_beam - 27.4 MB tests/test_post.py::test_elem_disp_plot[Y] - 24.7 MB tests/test_plotting.py::test_vplot[None] - 19.6 MB tests/test_mapdl.py::test_cyclic_solve - 19.3 MB tests/test_plotting.py::test_aplot[None] - 18.6 MB tests/test_plotting.py::test_eplot[True] - 15.5 MB tests/test_examples.py::test_download_cfx_mapping_example_data - 13.6 MB tests/test_plotting.py::test_aplot[False] - 12.6 MB tests/test_plotting.py::test_nplot[None-True] - 12.1 MB tests/test_plotting.py::test_file_type_for_plots - 10.2 MB tests/test_plotting.py::test_eplot[False] - 10.2 MB ```

germa89 commented 8 months ago

I do not have the bandwidth for this at the moment. So I'm keeping this issue open for the future.

germa89 commented 2 months ago

Further updates before removing pytest pluggin:

========================= memory consumption estimates =========================
pymapdl::tests::test_grpc.py::test_large_output                                      - 201.8 MB
pymapdl::tests::test_cli.py::test_convert_pipe                                       - 141.0 MB
pymapdl::tests::test_plotting.py::test_plotter_input                                 - 129.7 MB
pymapdl::tests::test_mapdl.py::test_components_selection_keep_between_plots          - 121.5 MB
pymapdl::tests::test_plotting.py::test_eplot[False]                                  - 108.9 MB
pymapdl::tests::test_convert.py::test_converter_cli                                  - 102.5 MB
pymapdl::tests::test_examples.py::test_detach_examples_submodule                     - 99.0 MB
pymapdl::tests::test_plotting.py::test_aplot[False]                                  - 96.6 MB
pymapdl::tests::test_plotting.py::test_pick_node_special_cases                       - 95.1 MB
pymapdl::tests::test_plotting.py::test_aplot[None]                                   - 94.7 MB
Details

``` ========================= memory consumption estimates ========================= pymapdl::tests::test_grpc.py::test_large_output - 201.8 MB pymapdl::tests::test_cli.py::test_convert_pipe - 141.0 MB pymapdl::tests::test_plotting.py::test_plotter_input - 129.7 MB pymapdl::tests::test_mapdl.py::test_components_selection_keep_between_plots - 121.5 MB pymapdl::tests::test_plotting.py::test_eplot[False] - 108.9 MB pymapdl::tests::test_convert.py::test_converter_cli - 102.5 MB pymapdl::tests::test_examples.py::test_detach_examples_submodule - 99.0 MB pymapdl::tests::test_plotting.py::test_aplot[False] - 96.6 MB pymapdl::tests::test_plotting.py::test_pick_node_special_cases - 95.1 MB pymapdl::tests::test_plotting.py::test_aplot[None] - 94.7 MB pymapdl::tests::test_plotting.py::test_aplot[True] - 91.1 MB pymapdl::tests::test_plotting.py::test_plot_nodal_values - 88.4 MB pymapdl::tests::test_plotting.py::test_plots_no_vtk[kplot] - 73.0 MB pymapdl::tests::test_plotting.py::test_eplot[None] - 69.1 MB pymapdl::tests::test_plotting.py::test_pick_node_select_unselect_with_mouse - 67.2 MB pymapdl::tests::test_plotting.py::test_pick_areas[U] - 61.2 MB pymapdl::tests::test_plotting.py::test_kplot[True] - 61.1 MB pymapdl::tests::test_plotting.py::test_pick_areas[R] - 60.8 MB pymapdl::tests::test_plotting.py::test_pick_kp[S] - 59.6 MB pymapdl::tests::test_plotting.py::test_labels_colors_background[red] - 59.1 MB pymapdl::tests::test_plotting.py::test_pick_areas[A] - 58.9 MB pymapdl::tests::test_plotting.py::test_show_bounds - 58.8 MB pymapdl::tests::test_misc.py::test_plain_report - 58.6 MB pymapdl::tests::test_plotting.py::test_pick_areas[S] - 57.9 MB pymapdl::tests::test_plotting.py::test_plots_no_vtk[aplot] - 56.7 MB pymapdl::tests::test_plotting.py::test_bc_bc_labels - 55.6 MB pymapdl::tests::test_examples.py::test_download_manifold_example_data - 55.2 MB pymapdl::tests::test_plotting.py::test_plots_no_vtk[nplot] - 53.5 MB pymapdl::tests::test_plotting.py::test_bc_plot_options[True-True-True] - 49.9 MB pymapdl::tests::test_plotting.py::test_kplot[None] - 47.5 MB pymapdl::tests::test_plotting.py::test_plots_no_vtk[lplot] - 47.0 MB pymapdl::tests::test_plotting.py::test_vplot_show_volume_numbering - 46.3 MB pymapdl::tests::test_plotting.py::test_single_glyph[0-TEMP] - 43.1 MB pymapdl::tests::test_plotting.py::test_cmplot_individual[NODE] - 40.6 MB pymapdl::tests::test_mapdl.py::test_cyclic_solve - 40.6 MB pymapdl::tests::test_commands.py::test_cmd_class_dlist_vm - 40.2 MB pymapdl::tests::test_plotting.py::test_cmplot_individual[ELEM] - 39.8 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads1-field2] - 39.6 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads1-field3] - 39.5 MB pymapdl::tests::test_plotting.py::test_lplot[True] - 39.2 MB pymapdl::tests::test_plotting.py::test_background - 38.9 MB pymapdl::tests::test_plotting.py::test_pick_kp[R] - 37.7 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads2-field2] - 34.6 MB pymapdl::tests::test_plotting.py::test_single_glyph[50-VOLT] - 34.3 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads3-field0] - 33.9 MB pymapdl::tests::test_plotting.py::test_download_file_with_vkt_false - 33.7 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads1-field4] - 33.4 MB pymapdl::tests::test_plotting.py::test_cmplot_all[KP] - 32.8 MB pymapdl::tests::test_plotting.py::test_color_areas_individual[color_areas0] - 32.8 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads3-field3] - 32.7 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads2-field3] - 32.6 MB pymapdl::tests::test_plotting.py::test_pick_kp[A] - 32.4 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads1-field0] - 32.2 MB pymapdl::tests::test_plotting.py::test_bc_plot_bc_labels[bc_labels5] - 31.6 MB pymapdl::tests::test_plotting.py::test_single_glyph[50-CHRG] - 31.5 MB pymapdl::tests::test_mapdl.py::test_use_vtk - 31.4 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads3-field4] - 30.9 MB pymapdl::tests::test_plotting.py::test_single_glyph[0-HEAT] - 30.4 MB pymapdl::tests::test_mapdl.py::test_screenshot - 30.3 MB pymapdl::tests::test_plotting.py::test_vplot_multi_numbering - 29.9 MB pymapdl::tests::test_plotting.py::test_single_glyph[0-FY] - 29.5 MB pymapdl::tests::test_plotting.py::test_bc_plot_options[False-True-False] - 29.2 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads3-field1] - 28.7 MB pymapdl::tests::test_plotting.py::test_single_glyph[0-VOLT] - 28.7 MB pymapdl::tests::test_plotting.py::test_single_glyph[0-FZ] - 28.7 MB pymapdl::tests::test_plotting.py::test_single_glyph[50-HEAT] - 28.5 MB pymapdl::tests::test_plotting.py::test_single_glyph[0-FX] - 28.2 MB pymapdl::tests::test_plotting.py::test_single_glyph[500-HEAT] - 28.0 MB pymapdl::tests::test_plotting.py::test_bc_plot_bc_labels[bc_labels6] - 27.8 MB pymapdl::tests::test_grpc.py::test_download_without_target_dir[myfile0.txt-expected_output0] - 27.4 MB pymapdl::tests::test_plotting.py::test_single_glyph[500-UX] - 26.5 MB pymapdl::tests::test_plotting.py::test_single_glyph[500-VOLT] - 26.4 MB pymapdl::tests::test_plotting.py::test_labels_colors_background[black] - 26.4 MB pymapdl::tests::test_parameters.py::test__get_parameter_array[1e+51] - 26.3 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads3-field2] - 26.0 MB pymapdl::tests::test_plotting.py::test_color_areas_individual[color_areas2] - 25.4 MB pymapdl::tests::test_plotting.py::test_pick_nodes[U] - 25.3 MB pymapdl::tests::test_plotting.py::test_single_glyph[50-TEMP] - 25.2 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads0-field4] - 24.0 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads2-field0] - 23.2 MB pymapdl::tests::test_krylov.py::test_check_full_file_exist - 22.7 MB pymapdl::tests::test_mapdl.py::test_load_array_types[array0] - 22.6 MB pymapdl::tests::test_plotting.py::test_single_glyph[500-CHRG] - 20.6 MB pymapdl::tests::test_grpc.py::test_download_with_extension[txt-myfile0-expected_output1] - 20.4 MB pymapdl::tests::test_grpc.py::test_read_input_file[static.dat] - 20.3 MB pymapdl::tests::test_plotting.py::test_single_glyph[500-FY] - 20.2 MB pymapdl::tests::test_plotting.py::test_cpos_input - 19.6 MB pymapdl::tests::test_plotting.py::test_plots_no_vtk[eplot] - 19.4 MB pymapdl::tests::test_plotting.py::test_color_areas_individual[color_areas1] - 19.2 MB pymapdl::tests::test_grpc.py::test_clear_multiple - 19.2 MB pymapdl::tests::test_plotting.py::test_file_type_for_plots - 19.1 MB pymapdl::tests::test_grpc.py::test__download - 18.0 MB pymapdl::tests::test_krylov.py::test_krylov_with_pressure_load[L1] - 17.6 MB pymapdl::tests::test_plotting.py::test_node_numbering_order - 17.6 MB pymapdl::tests::test_plotting.py::test_plots_no_vtk[vplot] - 17.2 MB pymapdl::tests::test_plotting.py::test_bc_plot_options_fields[loads2-field4] - 17.0 MB pymapdl::tests::test_mapdl.py::test_lsread - 16.9 MB pymapdl::tests::test_examples.py::test_failed_download - 16.8 MB pymapdl::tests::test_mesh_grpc.py::test_non_empty_mesh - 16.6 MB pymapdl::tests::test_grpc.py::test_cmatrix - 16.5 MB pymapdl::tests::test_plotting.py::test_vplot_multiargs - 16.4 MB pymapdl::tests::test_mapdl.py::test_cdread_in_python_directory - 16.3 MB pymapdl::tests::test_krylov.py::test_krylov_with_pressure_load[L2] - 16.1 MB pymapdl::tests::test_plotting.py::test_plot_empty_mesh - 16.0 MB pymapdl::tests::test_plotting.py::test_cmplot_all[NODE] - 15.7 MB pymapdl::tests::test_mapdl.py::test_cwd - 15.4 MB pymapdl::tests::test_pool.py::test_heal - 15.4 MB pymapdl::tests::test_plotting.py::test_pick_nodes[A] - 15.2 MB pymapdl::tests::test_plotting.py::test_bc_plot_options[True-False-False] - 15.1 MB pymapdl::tests::test_mapdl.py::test_tbft[expdata-.dat-] - 224.0 KB pymapdl::tests::test_mesh_grpc.py::test_nodes - 224.0 KB pymapdl::tests::test_post.py::test_disp[z] - 224.0 KB pymapdl::tests::test_post.py::test_nodal_principal_stress[2] - 224.0 KB pymapdl::tests::test_post.py::test_element_stress[min-1] - 224.0 KB pymapdl::tests::test_solution.py::test_temperature_cnv - 224.0 KB pymapdl::tests::test_mapdl.py::test_multiline_fail - 220.0 KB pymapdl::tests::test_mapdl.py::test_load_table[dim_cols3-dim_rows0] - 220.0 KB pymapdl::tests::test_mapdl.py::test_input_strings - 216.0 KB pymapdl::tests::test_mapdl.py::test_input_inside_non_interactive - 212.0 KB pymapdl::tests::test_geometry.py::test_geometry_names[volumes-volume-6] - 200.0 KB pymapdl::tests::test_inline_functions::test_field_component_queries.py::TestFieldComponentValueGetter::test_mag - 196.0 KB pymapdl::tests::test_post.py::test_nodal_contact_friction_stress - 196.0 KB pymapdl::tests::test_inline_functions::test_field_component_queries.py::TestFieldComponentValueGetter::test_pressure - 188.0 KB pymapdl::tests::test_post.py::test_nodal_principal_total_strain[2] - 184.0 KB pymapdl::tests::test_post.py::test_nodal_eqv_stress - 180.0 KB pymapdl::tests::test_mapdl.py::test_load_array[3-1] - 156.0 KB pymapdl::tests::test_mesh_grpc.py::test_element_node_components - 144.0 KB pymapdl::tests::test_launcher.py::test__verify_version_pass[23.2_0] - 140.0 KB pymapdl::tests::test_post.py::test_nodal_component_stress[Z] - 112.0 KB pymapdl::tests::test_misc.py::test_mapdl_info - 100.0 KB pymapdl::tests::test_krylov.py::test_non_valid_inputs_gensubspace[10-100-3-The 'check_orthogonality' value for building the Krylov subspace must be] - 96.0 KB pymapdl::tests::test_post.py::test_nodal_elastic_strain_intensity - 88.0 KB pymapdl::tests::test_mapdl.py::test_parameter_deletion[asdf] - 80.0 KB pymapdl::tests::test_post.py::test_nodal_principal_stress[1] - 80.0 KB pymapdl::tests::test_post.py::test_nodal_principal_total_strain[1] - 68.0 KB pymapdl::tests::test_post.py::test_elem_disp[X] - 52.0 KB pymapdl::tests::test_post.py::test_nodal_elastic_principal_strain[2] - 32.0 KB pymapdl::tests::test_inline_functions::test_geometry_queries.py::TestAngleQueries::test_anglek[coords3] - 28.0 KB pymapdl::tests::test_krylov.py::test_non_valid_inputs_expand[True-5-l-inf-The 'residual_computation' must be True or False] - 28.0 KB pymapdl::tests::test_inline_functions::test_selection_queries.py::TestKSEL::test_selected - 24.0 KB pymapdl::tests::test_parameters.py::test_parameters_name_error[Not valid sign --run] - 24.0 KB pymapdl::tests::test_geometry.py::test_vsymm - 16.0 KB pymapdl::tests::test_grpc.py::test_download_with_extension[None-file*.err-None] - 16.0 KB pymapdl::tests::test_mapdl.py::test_set_parameters_arr_to_scalar - 16.0 KB pymapdl::tests::test_mapdl.py::test_non_interactive - 16.0 KB pymapdl::tests::test_xpl.py::test_step_where - 16.0 KB pymapdl::tests::test_convert.py::test_convert_star_slash[parameters1] - 12.0 KB pymapdl::tests::test_mapdl.py::test_nodes - 12.0 KB pymapdl::tests::test_mapdl.py::test_non_valid_kwarg - 12.0 KB pymapdl::tests::test_plotting.py::test_single_glyph[50-FZ] - 12.0 KB pymapdl::tests::test_convert.py::test_auto_exit - 8.0 KB pymapdl::tests::test_mapdl.py::test_set_get_parameters[parm4] - 8.0 KB pymapdl::tests::test_convert.py::test_clear_at_start[None] - 4.0 KB pymapdl::tests::test_geometry.py::test_va - 4.0 KB pymapdl::tests::test_grpc.py::test_download[myfile*-expected_output2] - 4.0 KB pymapdl::tests::test_inline_functions::test_selection_queries.py::TestASEL::test_selected - 4.0 KB pymapdl::tests::test_mapdl.py::test_distributed - 4.0 KB pymapdl::tests::test_parameters.py::test_parameters_name[asd-get] - 4.0 KB pymapdl::tests::test_parameters.py::test_parameters_name[_array2d_(1,1)-parameters] - 4.0 KB ```

Reference: https://github.com/ansys/pymapdl/actions/runs/9957335555/job/27509331652?pr=3273

GitHub
fix: removing io error when logging to closed streams · ansys/pymapdl@406153c
Pythonic interface to MAPDL. Contribute to ansys/pymapdl development by creating an account on GitHub.