I am new to Julia and recently try to learn to do optimization using JuMP.
I use the Quadratically constrained programs example in JuMP document website.

using JuMP
import Ipopt
import Test

function example_qcp(; verbose = true)
model = Model(Ipopt.Optimizer)
set_silent(model) @variable(model, x) @variable(model, y >= 0) @variable(model, z >= 0) @objective(model, Max, x) @constraint(model, x + y + z == 1) @constraint(model, x * x + y * y - z * z <= 0) @constraint(model, x * x - y * z <= 0)
optimize!(model)
if verbose
print(model)
println("Objective value: ", objective_value(model))
println("x = ", value(x))
println("y = ", value(y))
end
Test.@test termination_status(model) == LOCALLY_SOLVED
Test.@test primal_status(model) == FEASIBLE_POINT
Test.@test objective_value(model) ≈ 0.32699 atol = 1e-5
Test.@test value(x) ≈ 0.32699 atol = 1e-5
Test.@test value(y) ≈ 0.25707 atol = 1e-5
return
end

example_qcp()
When I run it in Jupyterlab, it says run out of memory, and I also tried vscode, it keeps
running without any answer.
How can I fix this problem to solve the optimization?

Cannot reproduce (see below), the first run of the model takes a few seconds because of precompilation, while the second run solves in 0.01 seconds, with 2kb memory allocated so it seems unlikely that this small problem would run out of memory?

Are you on the latest versions of Julia and all packages?

julia> example_qcp()
******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
Ipopt is released as open source code under the Eclipse Public License (EPL).
For more information visit https://github.com/coin-or/Ipopt
******************************************************************************
Max x
Subject to
x + y + z == 1.0
x² + y² - z² <= 0.0
x² - z*y <= 0.0
y >= 0.0
z >= 0.0
Objective value: 0.32699283491387243
x = 0.32699283491387243
y = 0.2570658388068964
(jl_JTiMl3) pkg> st
Status `...\Temp\jl_JTiMl3\Project.toml`
[b6b21f68] Ipopt v0.9.1
[4076af6c] JuMP v0.22.2
julia> versioninfo()
Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)

I have updated JuMP and Ipopt packages.
It’s Ok now. Before I installed several other packages
which limits them to update to the latest version.
I have obtained the solutions:
Obj value: 0.32699283491387243 x= 0.32699283491387243 y= 0.2570658388068964